Snap is a package management system and software deployment which was developed by Canonical for the Linux operating system. The packages, called as snaps, and the tool for using them is called as snapd. Snap was originally designed for Ubuntu. Snap runs across a range of Linux distributions. The system is designed to work for internet of things, cloud and desktop computing.
Snap is available for CentOS 8 and CentOS 7, where the packages for CentOS 8 and CentOS 7 are in each distribution’s respective Extra Packages for Enterprise Linux (EPEL) repository. In this article we will discuss how to install snapd on Centos 8. The snapd version while this article is being written is 2.45 which was released on July 15, 2020.
snapd Installation on CentOS 8 Steps
On this section we will briefly discuss how to install snapd.
- Adding EPEL repository
- Installing snapd
- Enable Snap.socket
- Installing Snap Store
Adding EPEL repository
The first step on
snapd installation is to add EPEL repository to CentOS 8 system and then upgrade the system, this can be done by submitting the command line below:
[ramans@otodiginet ~]$ sudo dnf install epel-release [ramans@otodiginet ~]$ sudo dnf upgrade
Once the EPEL repository has been added with no errors found, then we go to install the snapd, this step is done by submitting command line below :
[ramans@otodiginet ~]$ sudo yum install snapd
the output could be :
Installed: snap-confine-2.45.2-1.el8.x86_64 snapd-2.45.2-1.el8.x86_64 snapd-selinux-2.45.2-1.el8.noarch
Enable Snap.socket And Enable Classic snap Support
snapd is installed successfully, the we need to enable the
snap.socket, by submitting command line below :
[ramans@otodiginet ~]$ sudo systemctl enable --now snapd.socket [sudo] password for ramans: Created symlink /etc/systemd/system/sockets.target.wants/snapd.socket → /usr/lib/systemd/system/snapd.socket.
The Snap packages requires a /snap directory. This capability doesn’t bundled with Snap itself, and then ensure it will be capable install any Snap package, we have to create a symbolic link to enable classic Snap support. This step is done by submitting command line below :
[ramans@otodiginet ~]$ sudo ln -s /var/lib/snapd/snap /snap
We can verify the snapd installation by querying the snapd version, as command line below.
[ramans@otodiginet ~]$ snap --version snap 2.45.2-1.el8 snapd 2.45.2-1.el8 series 16 centos 8 kernel 4.18.0-193.6.3.el8_2.x86_64
It is recommended to log out and back in again or restart the system to ensure snap’s paths are updated correctly.
Install Snap Store
For those who used to be using desktop environment, snaps can be more readily discovered, installed and managed from the Snap Store desktop app. This step is easy to be done. We submit the command line below :
[ramans@otodiginet ~]$ sudo snap install snap-store [sudo] password for ramans: the output on my system console is as seen below :
2020-07-21T20:22:35-07:00 INFO Waiting for automatic snapd restart… Warning: /var/lib/snapd/snap/bin was not found in your $PATH. If you've not restarted your session since you installed snapd, try doing that. Please see https://forum.snapcraft.io/t/9469 for more details. snap-store 3.31.1+git187.84b64e0b from Canonical✓ installed
The Snap Store can now be launched from desktop’s default launcher, the screen can be seen below.
We have through the snapd installation with command line and Snap Store installation for desktop environment.