This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How can I completely remove snap and flatpak from the system

Tags: None
(comma "," separated)
mkuru
Registered Member
Posts
8
Karma
0
OS
Hello Everyone,

How can I completely remove snap and flatpak stores and all their settings from the system? I just want to use .dep packages.
User avatar
pushback
Registered Member
Posts
6
Karma
0
Hello,
list installed snaps:
snap list

then remove all of them except core, for example the snap-store:
sudo snap remove snap-store

then remove snapd package:
sudo apt remove --purge snapd

Block snapd in order to not install them back automatically. To do so create a file, here with vim but you can use your favorite text editor:
vim /etc/apt/preferences.d/nosnap

and put those line in it:
Package: snapd
Pin: release *
Pin-Priority: -1

that tells apt to don't install snapd package.

To be sure if that was working try:
sudo apt install snapd

You should have an error and it is not installed.
mkuru
Registered Member
Posts
8
Karma
0
OS
Thanks Pushback. I haven't tested it yet, but I'm sure it will work. I'll post again when I test it.
User avatar
dchmelik
Registered Member
Posts
54
Karma
0
OS
Works and you can do similarly with flatpak.
        Putting the phone PC (marketing/inaccurate term 'smartphone') program snapd on desktop was one of worst mistakes Ubuntu ever made because not only you have less control but makes annoying /home/user/snap you either have to delete all snaps or list that directory/folder in /home/user/.hidden ... that's why I will never use snap, and I don't like flatpak either (though not similarly extremely annoying).
        I suggest this 01autoremove section.
Code: Select all
#/etc/apt/apt.conf.d/01autoremove
APT
{
  #... (i.e., other stuff)
  Move-Autobit-Sections
  {
        #...
        "flatpak";
        "snapd";
  };
};

I have these but don't know difference.
Code: Select all
#/etc/apt/preferences.d/99-blacklist-flatpak
Package: flatpak
Pin: release a=*
Pin-Priority: -10

Code: Select all
#/etc/apt/preferences.d/99-blacklist-snapd
Package: snapd
Pin: release a=*
Pin-Priority: -10


programmer since 1993, UNIX user since 1997, X/KDE user since '0s, forum member since 2008-11
mkuru
Registered Member
Posts
8
Karma
0
OS
Thanks Pushback and Dchmelik. It works fine with both methods. For both flatpak and snap.
User avatar
pushback
Registered Member
Posts
6
Karma
0
You are welcome! :)


Bookmarks



Who is online

Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan, mickae, Sogou [Bot]