How to remove snap from Ubuntu?
Andrew Henderson
How do I remove snap? apt pretends it's not there, but I can still call commands with it.
Trying to remove it says read only file system
# apt remove snap
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'snap' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
# snap whoami
email: - 0 5 Answers
The package is not called snap, but instead is snapd.
You will want to do
sudo apt autoremove --purge snapd 9 TL;DR:
sudo rm -rf /var/cache/snapd/
sudo apt autoremove --purge snapd gnome-software-plugin-snap
rm -fr ~/snapThis will completely remove snap, snapd, all installed snap packages and their data, and never again suggest snap packages in the software store.
Your output of mount, df and cat /proc/partitions will thank you ;)
UPDATE:
After successfully uninstalling snapd, make sure that it doesn't get installed again:
sudo apt-mark hold snapdOptionally test that the block works by trying to install the chromium-browser, which (at the time of writing) suddenly depends on the snapd and will drag everything just uninstalled back into your system upon installation:
sudo apt-get install chromium-browserThe installation should fail.
8I'm not sure if you asked especially for this, but if you just want to remove showing snap packages in Software (gnome-software; as I wanted to), you can just uninstall snap plugin with command
sudo apt-get remove --purge gnome-software-plugin-snapI don't know if --purge is necessary, but it works fine - Software doesn't show now packages from Snap Store, but I can still install them by command line with snap install [something]
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 snapdClear 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/snapdIn 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.
2if you want to remove snap store then you have to execute the following command in terminal:
sudo apt autoremove snapd 1