In this article we are going to shows how to install and use Snap on Ubuntu & CentOS/RHEL. If you want to learn about Snap package management system in Linux with Examples then this post is ideal for you.
Snap is a cross-distribution software deployment and package management system. Snap packages are safe to install and run, they auto-update and we can also roll-back the changes easily. Snap is the best and easiest way to install packages on Linux machine, including Ubuntu.
Snap applications are combined with all required dependencies into a single package which is install and run on all Linux distributions.
The main and important components of the snap package management system are show below:
- snapd – snapd is a background service that is used to manage and maintain your snaps on your Linux machine.
- snap – It is used to install and remove snaps.
- snapcraft – snapcraft is a framework and command-line tool for building snaps.
- snap store – Its is a place where open source developers can share their snaps and users can search and install them.
Install Snap on Ubuntu
To Install snap package manager in your Ubuntu machine , run the commands below :
sudo apt update
sudo apt install snapd
Install Snap on CentOS/RHEL
By default, Snap is not included in CentOS & RHEL default repository. You will need to add third party repository(EPEL) to install it.
Run the command below to install EPEL repository:
sudo yum install epel-release
Now you are able to install snap on your machine:
sudo yum install snapd
next, run the command below to enable the snap package:
$ sudo systemctl enable –now snapd.socket
Basic Snap Commands
Install Packages using Snap
Run the command below to install packages using snap:
sudo snap install package_name
Remove a package using Snap
Run the command below to Remove package from your Linux machine:
sudo snap remove package_name
Update package
Snap packages are updated automatically, you don’t need to run a command to update snap packages.
But you can also Upgrade Snap packages manually, run the command below to do that;
sudo snap refresh
OR
sudo snap refresh package_name
Find packages
Run the command below to find snap packages in the terminal:
sudo snap find search_text
Or you can visit the official Snap website.
List all installed snap packages
To list all the installed snap packages in your Linux machine, run the command below:
sudo snap list
Check Information of a package
You can check all information of a package by using command below:
sudo snap info package_name
Roll-back the changes
If you want to revert the recently updated Snap package to the previously installed version, run the command below:
sudo snap revert package_name
That’s all.
If you face any error and issue in above steps , please use comment box below to report.
If our tutorials helped you, please consider buying us a coffee. We appreciate your support!
Thank you for your support.