https://aabir-roy.github.io/feed.xml

Completely remove Snaps from Ubuntu

2025-03-25

Ubuntu is probably the only distro that pushes snaps. Flatpak seems to be dominant distribution-agnostic packaging format 2025. I was already a big flatpak user before migrating back to Ubuntu and wanted to continue the same.

Note, this is properly tested on Ubuntu 22.04.5 LTS.

This is the list of preinstalled snaps on Ubuntu 22.04.5 LTS.

$ snap list
Name                       Version           Rev    Tracking         Publisher    Notes
bare                       1.0               5      latest/stable    canonical**  base
core22                     20240823          1612   latest/stable    canonical**  base
firefox                    130.0-2           4848   latest/stable/…  mozilla**    -
gnome-42-2204              0+git.510a601     176    latest/stable/…  canonical**  -
gtk-common-themes          0.1-81-g442e511   1535   latest/stable/…  canonical**  -
snap-store                 41.3-77-g7dc86c8  1113   latest/stable/…  canonical**  -
snapd                      2.63              21759  latest/stable    canonical**  snapd
snapd-desktop-integration  0.9               178    latest/stable/…  canonical**  -

First remove the installed snaps:

$ for p in $(snap list | awk '{print $1}'); do 
    sudo snap remove $p
  done

This will leave bare, core22 and snapd.

$ snap list
Name    Version   Rev    Tracking       Publisher    Notes
bare    1.0       5      latest/stable  canonical**  base
core22  20240823  1612   latest/stable  canonical**  base
snapd   2.63      21759  latest/stable  canonical**  snapd

Manually remove these packages

$ sudo snap remove core22
$ sudo snap remove bare
$ sudo snap remove snapd
$ snap list
No snaps are installed yet. Try 'snap install hello-world'.

Completely remove snap.

$ sudo apt autoremove --purge snapd

To block future installs.

sudo bash -c "cat > /etc/apt/preferences.d/no-snapd.pref" << EOL
Package: snapd
Pin: origin ""
Pin-Priority: -1
EOL