Skip to content

Instantly share code, notes, and snippets.

@lao-tseu-is-alive
Created January 18, 2023 09:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lao-tseu-is-alive/2ba1933b65f6558e0ef3afdd6f7c5ae9 to your computer and use it in GitHub Desktop.
Save lao-tseu-is-alive/2ba1933b65f6558e0ef3afdd6f7c5ae9 to your computer and use it in GitHub Desktop.
Disable Snap on Ubuntu 22.04
# as root
snap list
systemctl disable snapd.service
systemctl disable snapd.socket
systemctl disable snapd.seeded.service
snap remove lxd
snap remove core20
snap remove snapd
snap list
apt autoremove --purge snapd
rm -rf /var/cache/snapd/
cd /root
rm -rf snap
@lao-tseu-is-alive
Copy link
Author

lao-tseu-is-alive commented May 11, 2023

as explained here
https://askubuntu.com/questions/1345385/how-can-i-stop-apt-from-installing-snap-packages

to prevent future snap installation you can :

cat <<EOF | sudo tee /etc/apt/preferences.d/nosnap.pref
# To prevent repository packages from triggering the installation of Snap,
# this file forbids snapd from being installed by APT.
# For more information: https://linuxmint-user-guide.readthedocs.io/en/latest/snap.html

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment