15

In Linux Mint 20, if I want to enable snap support to install snap packages, the usual command sudo apt install snapd to install snapd does not work.

As you can see in the picture below, if I run the command, it throws an error saying the "snapd package is missing or has been obsolete", "Package snapd is not available" and “Package snapd has no installation candidate.”

enter image description here

sarru1291
  • 493
  • 1
  • 3
  • 10
  • 1
    I don't think the screenshots are necessary. Screenshots slow everything, if you really want to prove it is working you can simply copy and paste the terminal output. –  Jun 17 '20 at 08:50

2 Answers2

24

The above error is happening because APT Package Manager blocks the installation of snap packages. With Linux Mint 20, the Mint dev team has disabled the snap or snapd support by default.

Though Linux Mint has never supported the snap, it has allowed installing Ubuntu snap store or snapd open-source client in previous releases by default.

Hence, now if anyone wants to install snap apps, they need to first enable snap support. For that, there is a solution as well.

To enable snap support on Mint 20, we can do either of two things:

  1. Delete the nosnap.pref file in the directory /etc/apt/preferences.d by running the command:

    sudo rm /etc/apt/preferences.d/nosnap.pref
    
  2. Comment the three lines of code in the same file.

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

    enter image description here

Now, install snapd:

sudo apt install snapd

Then, any snap apps:

sudo snap install <app-name>

There is also another method as well to install snap packages without interfering with nosnap.pref file. That is, installing app using version number:

sudo apt install <app-name> snapd=VERSION

enter image description here

pomsky
  • 1,088
  • 10
  • 19
sarru1291
  • 493
  • 1
  • 3
  • 10
0
$ sudo apt-get install snapd snapd-xdg-open

Reading package lists... Done
Building dependency tree
Reading state information... Done
Package snapd is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'snapd' has no installation candidate

This decision was taken due to Canonical’s decision to change the method of installing the Chromium web browser from APT to Snap as Linux Mint has no control of Snap store packages.

If you want to install snap, please follow the below steps

1. sudo rm /etc/apt/preferences.d/nosnap.pref
2. sudo apt update
3. sudo apt install -y snapd
4. snap version

snap       2.51.1+20.04ubuntu2
snapd      2.51.1+20.04ubuntu2
series     16
linuxmint  20.1
kernel     5.4.0-58-generic
subhashis
  • 101
  • 1