Sometimes, installing software applications in Linux can be a frustrating experience. You might run into missing libraries or dependencies when using the traditional package managers such as APT or DNF. This would then force you to search for the missing library or dependency only to find that it also depends on other dependencies. And this is where snap comes in.
Developed by Canonical and initially released in 2014, Snap is a software packaging system for the Linux operating systems. It makes use of snaps which are containerized packages that encapsulate an application alongside all its libraries, dependencies, configuration files, and other requirements needed for the software to run. Snaps address the issue of missing libraries and dependencies during software installation since all requirements are bundled together. snaps are also universal and distribution agnostic. You can install a snap package on any Linux flavor provided that snap is installed and enabled.
You can search through a wide selection of thousands of snaps hosted on the snap store. In this instructional guide, we demonstrate how to install and enable snap on Rocky Linux / AlmaLinux.
Step 1: Install EPEL repository
We will start off by installing the EPEL repository. To do this, execute the command:
$ sudo dnf install epel-release
EPEL provides a host of quality addon packages of Enterprise Linux which are essential in the installation of other packages.
Step 2: Install snapd on Rocky Linux / AlmaLinux
Once EPEL is installed, the next step is to install the snapd daemon which, in effect, installs Snap. To achieve this, run the command:
$ sudo dnf install snapd
This installs snapd and other additional packages as shown.
Once installed, start the snapd daemon:
$ sudo systemctl start snapd.socket
And enable the service on boot time.
$ sudo systemctl enable snapd.socket
To verify that the snapd daemon is running, execute:
$ sudo systemctl status snapd.socket
You can enable classic snap support by creating a symbolic link from /var/lib/snapd/snap to /snap as follows.
$ sudo ln -s /var/lib/snapd/snap /snap
To check the version of snap run the command:
$ snap --version
Step 3: Using snap to manage snap packages
You can run the ‘snap’ command to get information about snap, its usage, and commonly used commands:
For example, to find out the availability of an application as a snap package, run the snap find command followed by the name of the application. For example, to find out if Skype is available, run:
$ sudo snap find skype
To get additional information about the Skype application such as the Publisher, snap store URL licensing and the description about the application, run the command.
$ sudo snap info skype
To install the Skype, execute the command:
$ sudo snap install skype
To remove the Skype application run the command.
$ sudo snap remove skype
Those are just but a few snap commands that you can get started out with.
Snaps are quite huge in size and take up a larger disk space since the application comes bundled with dependencies, libraries, config files, and all that is required to make the installation seamless and successful. Therefore, it’s prudent to have a good internet connection before installation and ample disk space on your drive.
That’s it. Hope you liked this guide. We believe you can now install and enable snap of your Rocky Linux system.