How To Enable Snap And Install Snap Packages On Linux Mint 20?
With Linux Mint 20, the Mint dev team has decided to disable the snap support and block installation of Ubuntu snap packages 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.
Now, if you want to enable snap support to install snap apps in Linux Mint 20, the usual command sudo apt install snapd
to install snapd
will not work. This is because APT Package Manager blocks the installation stating “Package snapd is not available” and “Package snapd has no installation candidate.”
If you want to know the reason for dumping snap support, read the Mint blog post here. Clem Lefebvre, head of the Linux Mint project, has mentioned that the chromium snap package acts as a backdoor and installs the Ubuntu store without user consent. Hence, in Linux Mint 20, APT will forbid snapd from getting installed.
But there is also a way round to surpass the restriction from APT and install snap apps using snapd tool. All thanks to Leo Chavez, a co-host on the MintCast podcast, who shared the method on his Twitter post.
Hence, in this article, I will guide you on how to enable snap support in Linux Mint 20 and install snap packages with or without deleting nosnap.pref
file:
Linux Mint Blocks Ubuntu Snaps
As you can see in the picture below, if you run the usual command sudo apt install snapd,
it throws an error saying the snapd
package is missing or has been obsolete.
Even if you search for snapd
in the Software Manager of Linux Mint 20, instead of an Install button, you’ll get an unending spinning wheel.
So, the first thing we need to do to install snap packages is to enable the default disabled or blocked snap support on Linux Mint 20.
To give you a quick overview, here is a list of things I’ll go step-by-step to guide you from enabling snap support to installing snap packages and also disabling snap support back:
- Enabling snap support on Linux Mint 20
- Installing
snapd
tool - Install snap packages without removing
nosnap.pref
file - Disabling snap support on Linux Mint 20
How To Enable Snap Support On Linux Mint 20?
To enable snap on Linux Mint, you don’t have to go through a list of commands. You only need to know about a single file and tweak it to allow installing snapd.
The Mint dev team has included a new file named nosnap.pref
in the directory /etc/apt/preferences.d
.This file contains only three lines of code that blocks snapd package installation.
Package: snapd Pin: release a=* Pin-Priority: -10
Hence, you only need to either comment these three lines of code or delete the whole file nosnap.pref
to fully allow installing snap packages. I would recommend that you should remove the file only if you don’t wish to disable the snap again.
sudo rm /etc/apt/preferences.d/nosnap.pref
Once you delete or hide the block of code, Linux Mint 20 is ready to install snapd and then snap packages.
How To Install Snapd On Linux Mint 20?
We can now install snapd tool that won’t be blocked by APT package manager. To install it, run the command:
sudo apt install snapd
Once the installation finishes, you now have the full snap tool to install and manage snap packages. If you want to know the version and all commands available, run:
snap version snap --help
Install Snap Packages On Linux Mint 20
Here we reach the important section that you must be waiting for. As we now have full support and tools for the snap, we can install any snap application by running the command:
sudo snap install <app-name>
Install Snap Packages Without Deleting nosnap.pref
File
sudo apt install <app-name> snapd=VERSION
How To Disable Snap Support On Linux Mint 20?
If you’ve removed the nosnap.pref
file to enable snap, create a new file with the same in the directory /etc/apt/preferences.d/
and add the above mentioned three lines of code.
Adding the file will again disable the snap support and now you can’t install snap packages.
Wrapping Up
I hope you learned how to install snap packages on Linux Mint 20 by enabling the locked snap support first. Besides snapd, you can also use snap’s alternative Flatpak. Linux Mint has default support for Flatpak.
If you want to know what is Flatpak and how to use it on Linux, read our beginner’s guide here.