Fully Remove Snap from Ubuntu 22.04

List & Remove all snap packages

snap list

Remove everything you find in the list, starting with non-canonical packages. The following should work on a fresh install of Ubuntu 22.04.

sudo snap remove --purge firefox
sudo snap remove --purge gnome-3-38-2004
sudo snap remove --purge gnome-42-2204 
sudo snap remove --purge gtk-common-themes 
sudo snap remove --purge snapd-desktop-integration 
sudo snap remove --purge snap-store 
sudo snap remove --purge core20
sudo snap remove --purge core22
sudo snap remove --purge bare
sudo snap remove --purge snapd

Prevent apt from reinstalling snapd

Create a new file in /etc/apt/preferences.d/ and called nosnap.pref

sudo nano /etc/apt/preferences.d/nosnap.pref

Add the following to the file & save.

Package: snapd
Pin: release a=*
Pin-Priority: -10

Remove remnants

Remove user snap directory.

rm -rf ~/snap/

Remove cache directory for snapd.

sudo rm -rf /var/cache/snapd/

Daniel Iser is a professional WordPress plugin developer, and the author of plugins such as Easy Modal & Popup Maker. Founder of Wizard Internet Solutions he has been working with WordPress for over 7 years creating websites and tools for clients & blog authors.

Follow on:

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.