By default, Linux Mint does not support the Snap format and application installation from Snap Store. Also, here's how to change that on Linux Mint 18.x, Linux Mint 19.x, and Linux Mint 20.
Introduction
What is Snap?
Snap is a package management system offered by Canonical (developers of Ubuntu). One of its goals is to allow developers to provide, for an application, a single installer (a Snap package) that can be installed on any distribution regardless of its version and state. Indeed, all dependencies must be included in the package and the application will be executed in a sandbox which will isolate it from the system and strengthen security. Packages are centralized and distributed from a single app store: the Snap Store. The clients (what we install on our system) are under a free license (GPLv3), but not the server that hosts and distributes the packages to be installed ...
Initially only supported in Ubuntu (and for good reason ...), it is also possible to use it with other distributions.
Snap and Linux Mint
For those who don't yet know, Linux Mint is based on Ubuntu ...
However, Linux Mint, basic, does not allow the installation of snap packages. In fact, like some other distributions, the developers of Linux Mint have made the choice, since Linux Mint 18.3, to integrate a basic alternative to this format, the Flatpak format, and not to preinstall the take in exchange for the Snap format.
A Flatpak package also has its dependencies and can therefore be installed on any system that supports it.
Applications in Flatpak formats are also executed in a Sandbox.
It also benefits from an application store, the Flathub. But the Flathub is not the only possible source to get a Flatpak package. It is possible to have other repositories or sources.
And it is completely free (LGPL-2.1 license) client and server.
In addition, it has the advantage of not requiring administrator rights to install a package ...
Finally, for those who really want to, it is still possible to install the snap manager from the official Linux Mint repositories.
Install support for snap format in Linux Mint
To do this, you have to install the snapd package. But since Linux Mint 20, the installation of this package is basically blocked.
This decision by Linux mint developers follows Canonical's decision to remove some popular DEB packages from Ubuntu 20.04 repositories (ex: chromium-browser) to replace them with Snap packages and thus try to impose this format. ….
However, this blockage is not irremediable….
Allow installation of snapd (only on Linux Mint 20)
To authorize, open a terminal (Ctrl + Alt + T).
Then, rename the APT preferences file nosnap.pref to, for example, nosnap.pref.bak:
sudo mv /etc/apt/preferences.d/nosnap.pref /etc/apt/preferences.d/nosnap.pref.bak
or delete it:
sudo rm /etc/apt/preferences.d/nosnap.pref
To recreate the file, open from a terminal, with administrator rights, the nano text editor (or other):
sudo nano /etc/apt/preferences.d/nosnap.pref
then copy the following lines:
# 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
and save the file in /etc/apt/preferences.d/nosnap.pref (Ctrl + S) and exit (Ctrl + X).
And update your APT cache:
sudo apt update
Install snap support on Linux Mint
To install snapd, do in a terminal:
sudo apt install snap
And restart.
To restart from the command line, do:
sudo reboot
Using snap in Linux Mint
The management of snap (installation, removal, ...) can be done through a graphical interface with the (optional) installation of the snap-store manager from a snap package:
sudo snap install snap-store
But, a command line management offers access to other equally interesting options ... (some examples below)
Also, an application installed in snap format can be launched from a launcher in the applications menu:
but also with a command line ...
In the commands indicated below, the words between [and] must be replaced by the appropriate text.
Install a snap package
To install a snap application, in command line do:
sudo snap install [package_name]
But, it is also possible to choose to install the application from another channel (stable version, beta version, current version of dev ...) if they exist.
To find out which versions are available for a package, do:
snap info [package_name]
So to install from the application from a specific channel, do:
sudo snap install --channel = [selected_channel] [package_name]
Launch a snap application
To launch an application from the command line, just enter its name. For example, for Chromium, do:
chromium
Sometimes it may be necessary to specify the path / snap / bin (folder containing all links to installed snap applications):
/ snap / bin / chromium
Find snap apps
To find the snap apps without the Snap Store installed, you can use its web version: https://snapcraft.io/store.
Update the installed snaps
Snap packages are automatically updated regularly.
To find out when the last update search took place and when the next one will be, do:
snap refresh --time
And to force the updates, do:
sudo snap refresh
It is also possible to change the channel for an application already installed with:
sudo snap refresh --channel = [selected_channel] [package_name]
Remove an installed snap package
Do:
sudo snap remove [package_name]
but a snapshot of its state will be kept for 31 days and restored in case of reinstallation. For a complete removal, do instead:
sudo snap remove [package_name] --purge
Other useful commands
To see the list of installed snap packages, do:
snap list
To revert to the previous version after an update, do:
sudo snap revert [package_name]

Commentaires
Enregistrer un commentaire