In recent long term support (LTS) releases of Ubuntu, Canonical has been adding more and more packages that are installed using snapd.
Snapd is a package manager that relies on static linking of dependencies, contrary to over two decades of Linux managing dependencies via dynamic linking, with Debian being the pioneer of this approach.
On desktop systems, packages like Firefox on Ubuntu are now forced to be in Snapd, rather than Debian. This is annoying, and counter intuitive for many reasons. Suffice it to say that those who have been using repositories in Debian format know that they get a robust system with minimal dependency issues, while also staying up to date at the same time.
So if you are like me and want to get rid of snap on your system, here is how to do it on Ubuntu Server LTS 22.04.
Which Packages are Installed via Snapd?
First, list the packages that are installed via snap, using this command:
The output will be similar to this:
Name Version Rev Tracking Publisher Notes
core20 20230613 1950 latest/stable canonical** base
lxd 5.0.2-838e1b2 24322 5.0/stable/? canonical** -
snapd 2.59.5 19457 latest/stable canonical** snapd
We need to remove all of those, but before we can remove lxd, we need to shut it down first:
sudo lxd shutdown
Remove Snapd Packages
Then remove the packages that are installed via snap:
sudo snap remove lxd
sudo snap remove core20
Remove Snapd Itself
And finally remove snapd itself, first from snap, then from apt:
sudo snap remove snapd
sudo apt remove snapd
Now you have a snapd free server system ...
On the desktop, I was able to remove snap on Xubuntu 20.04, but have not tried that on 22.04 yet.
If you have done this on a desktop, let me know in the comments below.