5

I am using ubuntu 20.04 LTS on my hp-notebook ( i5-6th gen, 8GB RAM, 1GB AMD Radeon graphics card). The snapd.services are causing my pc to boot slow (about 1 min 15 sec in userspace). Also, it takes about 15 sec from login screen to desktop.

Is there any way to completely remove all snaps, snappy package manager and snap files and cache without breaking any other packages?

Hades
  • 61

3 Answers3

7

I'm currently running Ubuntu 20.04 LTS in a real enviroment and in a VM and I removed snap snapd following this steps:

# stop snapd services
sudo systemctl stop snapd && sudo systemctl disable snapd
# purge snapd
sudo apt purge snapd
# remove no longer needed folders
rm -rf ~/snap
sudo rm -rf /snap /var/snap /var/lib/snapd /var/cache/snapd /usr/lib/snapd

Then, in order to avoid that other applications may reinstall it (chromium-browser is an example of application that restores snapd even if installed via apt) you can create a file no-snap.pref by issuing:

sudo -H gedit /etc/apt/preferences.d/no-snap.pref

and then copying the following content in it:

# To install snapd, specify its version with 'apt install snapd=VERSION'
# where VERSION is the version of the snapd package you want to install.
Package: snapd
Pin: release a=*
Pin-Priority: -10

The file above prevents you from installing snapd if you type sudo apt install snapd, but allows you to install it if you run sudo apt install snapd=2.45.1+20.04.2 (the version in the command is just an example).


Original answer (2020/06/19): I'm currently running Ubuntu 20.04 in a real enviroment and in a VM and I removed snap following this article: https://www.kevin-custer.com/blog/disabling-snaps-in-ubuntu-20-04/

I've never had any kind of issue following these steps.

Note that if you receive some errors while removing some snap package, try to remove another one and then come back to the one that gave you troubles: snap packages may have some dependencies, and you cannot remove one before before another one.

Moreover, before the command sudo umount /snap/core/xxxx run sudo systemctl stop snapd

Lorenz Keel
  • 9,511
4

You should be able to remove all snap packages, as per the normal procedure:

sudo snap remove package-name

More info here: Snap in Ubuntu 16.04

When you have removed all packages, you can remove the snap daemon:

sudo apt purge snapd; rm -rf ~/snap

This should completely remove snap, and not break anything else.

Artur Meinild
  • 31,035
0

Remove the snap package as per the answer given by Arthur but I would advise against completely removing the daemon, rather disable it so it doesn't run at startup:

sudo systemctl disable snapd

And to check if disabled:

sudo systemctl is-enabled snapd

And to re-enable at a later date:

sudo systemctl enable snapd
George Udosen
  • 37,534