What is SNAP ???

Snap is containerized software packages that are simple to create & install. Snap packages are safe to run, they auto-update & we can also roll-back the changes easily. Snap is a bundle of an app and its dependencies in a single package that works without any modification across many Linux distributions.

Snap comes from Snappy which is used as a package management system originally designed for Ubuntu phone operating system.

In this tutorial, we will learn to install Snap on CentOS & Ubuntu systems. Once we install snap on Linux machines, we will also discuss some mostly used snap commands for package management.

Recommended Read: How do i install RPM packages on Ubuntu ???

Also Read: Using yum to download packages without installing them


Install Snap on Ubuntu

Installation of quite simple on the Ubuntu system as snap package is available with default Ubuntu repositories. To install snap, we can execute the following command,

$ sudo apt update && sudo apt install snapd

After that, you need to restart or log out & then log back in to update all the snap’s paths correctly. Once that’s done, we can use snap normally to manage packages.


Install Snap on CentOS/RHEL

Starting with CentOS 7.6+ & RHEL 7.6+, we can install Snap on CentOS systems using the EPEL repository. So first we need to install EPEL repository on CentOS system using the following command,

$ sudo yum install epel-release

Once epel repository has been install, we can install snap using the following command,

$ sudo yum install snapd

Once this is finished, we need to enable the snapd socket,

$ sudo systemctl enable --now snapd.socket

We now have snapd installed on our systems & if we also want to enable classic snap support then we can create a system link for the same,

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

Now we can either restart or log out & log back in to make sure that all the snapd paths are updated & then we can use snap to manage the packages on our CentOS/RHEL systems.


Essential Snap commands to know

Once we have snap installed, we should know some snap commands to help manage the packages on our system. So here are some essential commands for a snap that you should know,

  • Find packages

To find a package in the snap repository, execute the following command,

$ snap find package_query

  • List installed packages

To check all the installed packages on your system, run

$ snap list

  • Install Packages

To install a package using snap, execute the following from the terminal

$ snap install package

  • Remove package

To remove a package from the system, run

$ snap remove package

  • Information for a package

To check complete information for a package, use the following

$ snap info package

  • Update package

As mentioned above, snap packages are updated automatically & we might not be required to run the below-mentioned command at all but none the less, for your information,

$ snap refresh

This command will update the snap packages

That’s it for our tutorial on how to install SNAPD on Linux servers. Please feel free to send in any questions/queries you have regarding the article.

If you think we have helped you or just want to support us, please consider these:-

Connect to us: Facebook | Twitter

Donate us some of your hard-earned money: [paypal-donation]

Linux TechLab is thankful for your continued support.