CentOS

How to install and enable snap on CentOS 8

Snap store is one of the latest and emerging application stores available for installing applications and software on Linux. This post will first understand the snaps and snap store and then learn how to install and enable snap on CentOS 8.

What are Snaps?

Snaps are packages or application bundles consisting of the software and its required dependent software or packages.

Why Snaps?

  • Snap packages are becoming popular because of their easy installation on Linux-based Operating systems.
  • Snaps can be downloaded and installed on all major Linux-based operating systems from the snap store.
  • The snaps available at the snap store are dependency-free, secure, and easy to install.

What is a Snap Store?

The snap store is a store or hub of snaps or applications from where you can upload snaps or browse and install snaps or software of your choice in Linux using the Snapd service.

What is Snapd?

The snap daemon or shortened as Snapd runs in the background to manage the snap packages.

Alright, we have grasped the concepts of Snap and snap store. Let’s learn to install and enable Snap on CentOS 8.

Installation of Snap on CentOS 8

Snap does not come pre-installed on CentOS 8 like Ubuntu 20.04 Operating System, but we can download and install snap from the EPEL repository.

Step 1: Enable the EPEL repository on CentOS 8

First, enable the EPEL repository in CentOS 8 if it is not enabled using the command given below:

$ sudo dnf install epel-release

After enabling the EPEL repository, upgrade the system’s package repository to make your system up to date by typing the command given below:

$ sudo dnf upgrade

Alright, now we can easily install the snap from the EPEL repository.

Step 2: Install snapd package from the EPEL repository

To install the snapd on CentOS 8, type the command given below:

$ sudo dnf install snapd

After a couple of minutes, snap will be installed on CentOS 8.

For installing packages from the snap store, we need to enable the snap communication socket first.

Step 3: Enable the snap communication socket in CentOS 8

To install applications from the snap store, we need to enable the systemd unit that handles the snap socket. To enable the snap communication socket, type the command given below:

$ sudo systemctl enable snapd.socket --now

Also, create the link between “/var/lib/snapd/snap” and “/snap” to enable the classic snap support by typing the command given below:

$ sudo ln -s /var/lib/snapd/snap /snap

Alright, after enabling the snap socket, sign out from the system once,

And sign in back to ensure the updation of the paths of the snap.

Now, we will be able to install applications from the snap store.

Step 4: Install an application from the snap store

Let’s try to install any application from the snap store in CentOS 8 Operating system. For example, we want to install an application like the VLC media player from the snap store. To install the VLC media player from the snap store in CentOS 8 machine, type the command given below:

$ sudo snap install vlc

This is it.

The VLC media player is installed on CentOS 8 without caring about any dependency.

You can launch the VLC media player from the launcher of the CentOS 8 system.

Conclusion

This post contains the profound knowledge of Snaps, snap store, and snapd. This post went through a step-by-step guide, installed and enabled the Snap on CentOS 8 system. We have also tried to install an application and see that it is just like installing an application in a snap, and we do not have to handle and care about any dependent packages.

About the author

Shehroz Azam

Shehroz Azam

A Javascript Developer & Linux enthusiast with 4 years of industrial experience and proven know-how to combine creative and usability viewpoints resulting in world-class web applications. I have experience working with Vue, React & Node.js & currently working on article writing and video creation.