How to Remove Snap Apps & Block Them in Ubuntu 22.04

Last updated: April 19, 2022 — 5 Comments

Ubuntu is distributing more applications as the universal Snap package, but some users don’t like them. So I’m writing this tutorial for those want to completely get rid of Snap and prevent it from being installed back.

NOTE: Before getting started, please backup your app data, e.g., Firefox bookmarks. Attention that Ubuntu Software will also be removed after following this tutorial.

Step 1. Remove Snap apps and the Daemon

Press Ctrl+Alt+T on keyboard to open a terminal window. When it opens, run the commands below one by one.

1.) List all installed snap applications:

snap list

They are by default Snap Store (Ubuntu Software), Firefox, default theme, and few core packages.

2.) Remove the apps one by one, Firefox and Snap-store go first, then theme package, gnome platform (in sandbox), and finally base packages and snapd daemon. NOTE: the package names may vary depends on “snap list” output.

sudo snap remove --purge firefox
sudo snap remove --purge snap-store
sudo snap remove --purge gnome-3-38-2004

Also run snap remove command to remove “gtk-common-themes”, “snapd-desktop-integration”, “bare”, “core20”, and finally “snapd”.

3.) Finally remove the Snap daemon package via apt:

sudo apt remove --autoremove snapd

Step 2. Block Snap package

After completely removed snap packages, you may prevent Ubuntu from installing them back by settings low priority for the Snapd package. Here’s how to do the trick inspired by the way Linux Mint 20 did.

1.) Press Ctrl+Alt+T on keyboard to open terminal. When it opens, run the command below to create and open a configuration file:

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

When the file opens, paste lines below to tell refuse snapd from any repository:

# To prevent repository packages from triggering the installation of snap,
# this file forbids snapd from being installed by APT.

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

2. After save the file, refresh package cache via command:

sudo apt update

Now, whenever you try to installed a Snap package or the daemon, it outputs either unmet dependencies (snapd) or package has no installation candidate.

How to Restore:

If you change your mind, run the commands below at any time will install back the Snap apps.

Firstly, run command in terminal (Ctrl+Alt+T) to unblock the daemon:

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

Then, install Ubuntu Software via command:

sudo snap install snap-store

And install Firefox as snap if you want by running command:

sudo apt install firefox

Twitter

I'm a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to remind me outdated tutorial! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via [email protected] Buy me a coffee: https://ko-fi.com/ubuntuhandbook1

5 responses to How to Remove Snap Apps & Block Them in Ubuntu 22.04

  1. Thanks for this. All OK but one small error for us copy and paste enthusiasts. In Step 1 para 2.) should be “snapd-desktop-integration”

  2. Thank you for this, got rid of all the extra bits that seemed to still be there after running Popeys script

  3. Also remove redundant folders if there are any left:

    rm -rf ~/snap

    sudo rm -rf /snap /var/snap /var/lib/snapd /var/cache/snapd /usr/lib/snapd

  4. Stephen Cormier April 22, 2022 at 3:28 am

    Worked great thanks for the posting.

Leave a Reply

Text formatting is available via select HTML.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

*

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