33

sudo apt-get install chromium-browser for some reason installs not a proper apt-get package but is installing the chromium snap.

I am aware that blocking such installs will not magically establish a maintained package, and would result in an installation failure. But I prefer to get error and install manually - from source or in unlikely cases from snap.

I want to never install anything using snap (for start, due to Snap Store closed-source practice). Especially not silently when I install using apt-get.

How can I disable snaps in gnome-software centre? is not answering my question as I want to get rid of snap infestation in apt - not in gnome-software-center.

11
  • 1
    Look at this: askubuntu.com/q/1317194/1157519
    – Levente
    Jun 12, 2021 at 7:45
  • 1
    @Levente Thanks! Unfortunately it is not helping - I want installation to fail if it would require installing snap with apt-get. Jun 12, 2021 at 7:55
  • 2
    The Chromium browser is not packaged as a deb and hasn't been for numerous releases (well before 20.04 anyway; 18.04 had it as a deb package but late 2018 it first appeared as snap - see discourse.ubuntu.com/t/… discourse.ubuntu.com/t/… ; May-2018). It's available as deb only as stub so users don't get errors telling them package isn't found (it just loads the snap for them). I find discover is pretty easy to pick snaps and debs
    – guiverc
    Jun 12, 2021 at 7:55
  • 4
    @guiverc I am fine with being unable to install Chromium with apt. In fact, if it requires snap - I want to be unable to do this. Jun 12, 2021 at 7:57
  • 2
    This is why I'm still on 18.04LTS, and will leave the Ubuntu world when it goes EOL.
    – RonJohn
    Jun 13, 2021 at 7:21

1 Answer 1

19

You have to remove snapd from the system by

sudo apt-get autopurge snapd

and then create special configuration file for APT, as LinuxMint did:

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

This will prevent Snaps installation in future.

4
  • 1
    Is it safe to immediately perform the autopurge? Many tutorials involve first disabling snap, removing the individual snaps, etc. Perhaps yes, but this may then leave unused files and folders behind.
    – vanadium
    Jun 12, 2021 at 9:40
  • 1
    The configuration script will do for us what is needed.
    – N0rbert
    Jun 12, 2021 at 9:50
  • 1
    @N0rbert so by doing this, how do I install Firefox through apt? It depends on snapd
    – mslot
    Apr 23 at 6:07
  • 2
    If you still want Firefox, first uninstall the Snap, then add the file above, then get Firefox from one of a few different places, as listed here: askubuntu.com/questions/1369159/… May 9 at 7:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.