I have just installed a server and apparently it also comes pre-installed with snaps that besides being useless are also blocking the shutdown of the device.
This very good blog post has instructions for cleaning up your system. It basically says:
snap list
sudo snap remove each_item # (by dependency order)
sudo umount /snap/core/xxxx # On 20.04, on 20.10 /var/snap
sudo apt purge snapd
Clear various files at /home/*/snap
, /usr/lib/snap
and alike
rm -rf ~/snap
sudo rm -rf /snap
sudo rm -rf /var/snap
sudo rm -rf /var/lib/snapd
In case of the server the only snap was lxd
(something Canonical is pushing as an alternative to docker).
IMHO this a bit of a conflict of interest between Canonical and the users. Users should be able to opt-in whatever they need and not be forced to uninstall stuff the hard way.
In any case, at least for the moment this is reversible. You can remove specific packages and the snap daemon and install later if needed.
--purge
? The OP didn't say the removal must also remove the configs. – Ruslan May 14 '18 at 10:44ubuntu-desktop
meta-package gets deleted for things like this and you are forced to re-install it later on if you want to upgrade. Will that be the case here? – tutuca Nov 17 '19 at 03:26snap remove
instead. – dobey Mar 06 '20 at 15:35sudo apt-mark hold snapd
to make sure it doesn't inadvertently come back. – mivk Mar 28 '21 at 21:04/snap/bin
from your PATH. It is hardcoded in/etc/environment
and/etc/sudoers
. – nyg Nov 20 '22 at 13:36