Ubuntu Snaps in WSL & zsh

Ubuntu Snaps in WSL & zsh

What on earth are “Snaps”?

These are fully containerized versions of applications that can be easily “installed” from the Snap Store. This store is run by canonical, but it looks like they support other distributions of Linux.

From the link above:

Introduction to snaps

Snaps are a secure and scalable way to embed applications on Linux devices. A snap is an application containerised with all its dependencies. A snap can be installed using a single command on any device running Linux. With snaps, software updates are automatic and resilient. Applications run fully isolated in their own sandbox, thus minimising security risks.

Snaps are hosted in the global Snap Store, an application repository hosted and managed by Canonical, and are free for anyone to download. Snaps can be created by anyone - existing software can be packaged as a snap or new software can be built from scratch using snap packaging. There is also an active, vibrant community of developers and users, with a forum where anyone can ask questions.

Packaging IoT applications as snaps bring the following benefits:

Reliable Snaps use transactional updates, meaning that if for any reason an update you push to your snap fails, the snap will roll back to its last stable state
Modular Snaps are reusable, they enable a loosely-coupled software architecture for embedded software and are compatible across architectures
Robust With snaps, software updates are automatic and over-the-air (OTA), meaning your software is never out-of-date
Optimised Snaps harness delta updates, minimising the storage and bandwidth needed when updating software. Read more about differential updates here

I wanted to install the great DBeaver database tool, but it isn’t in the mainline apt repos (and I don’t trust third-party apt repos). It is available as a Snap, though.

sudo snap install dbeaver-ce

Now, though … how to run it, as it wasn’t found in my $PATH.

export PATH=$PATH:/snap/bin

That did the trick! I added the above to my .zshrc file also, for persistence.

links