Remove Snap on Ubuntu

1. Remove Installed Snaps

First delete all installed Snap packages before removing the daemon. Run this command to see a list of the installed Snap packages:
snap list

Then remove every package in the list one by one. Use the name listed in the "Name" column in the following command:
sudo snap remove <package_name>

2. Purge the Snap Daemon

Once you've removed all the installed snaps, purge the Snap service and associated configuration files with the following command:
sudo apt purge snapd

3. Clean Up Leftover Directories

Delete the leftover data directories from your home folder and system with the following command: rm -rf ~/snap
sudo rm -rf /var/cache/snapd/


4. Prevent Snap from Reinstalling

Ubuntu may automatically reinstall Snap during future system updates. To block this, create an APT preference file with nano:
sudo nano /etc/apt/preferences.d/nosnap.pref

Paste the following lines into the file, then save (Ctrl+O, Enter), and exit (Ctrl+X):
Package: snapd
Pin: release a=*
Pin-Priority: -10


Back to the main page