All you need to know about Snap on Ubuntu

In Linux, there are several traditional package formats such as DEB and RPM that are prepared for distros using these package formats. Despite being an efficient method, it has a major problem: the packages require the system to have the libraries it needs available. This eventually leads to a problem because if the libraries are updated and the program is updated, it would be incompatible with the Linux distribution. To avoid this, a tool was invented and in this post, I will explain to you how to use snap on Ubuntu.

What is snap?

Snap is a technology that allows you to install self-contained applications on a Linux system. In other words, you can install applications without worrying about underline dependencies and libraries.

To reinforce the above, I will give an example. Let’s suppose that an application requires an X library because a DEB or RPM package is created and nothing happens. But if the library is updated and the application requires it, you will not be able to have the last version of the program since there would be a problem with dependencies. Well, the snap comes to solve this for us and it doesn’t matter what Linux distribution it is, a snap program will run without library problems.

The main sponsor of this project is Canonical, the company behind the support and development of Ubuntu. This indicates that snap is installed by default on any Ubuntu version since 18.04. Therefore, it is expected to work great on Ubuntu and derivatives.

Advantages and disadvantages of using Snap on Ubuntu

Although Snap is quite safe, you have to take into account that a program packaged using snap is quite heavy. This is because not only does the program itself go into the package, but also all the required libraries.

On the other hand, this space is compensated by the ability to install recent versions of applications on older systems. For example, despite using Ubuntu 16.04 you can have the latest version of Visual Code installed. This brings a lot of advantages for the users.

Security also plays an important role, because snap applications are isolated from the rest of the system and applications. This makes it impossible for a program to modify essential parts of the system.

Install Snap on Ubuntu

Snap is already available for Ubuntu 16.04 onwards. For older Ubuntu versions or flavors you can install snap using the commands given below.

$ sudo apt update
$ sudo apt install snapd

Once installation is complete, run the below command to see the version.

$ snap --version
snap 2.51.1
snapd 2.51.1
series 16
ubuntu 20.04
kernel 5.4.0-72-generic

Using snap on Ubuntu

The command that allows you to manipulate the snap packages is precisely snap. This command, like others, has a different syntax and options.

To display the help of this command, open a terminal and execute the following:

:~$ snap --help
1.- Snap command help
1.- Snap command help

There you can see all the commands to manipulate the snap packages.

Find and install snap packages

First of all, if you want to find a specific application, you only need to execute the following command:

:~$ sudo snap find [app_name]

In case you do not write any arguments, the program will show you some popular applications.

:~$ sudo snap find
2.- List available applications with snap
2.- List available applications with snap

There you will only have a small sample of the applications that you can install using snap.

To install some snap application, just run the following command:

:~$ sudo snap install [app_name]

In this case, I will install slack by snap. As the notes column has the classic attribute, then it must be added as a parameter. The command is left as follows:

:~$ sudo snap install slack --classic

However, many applications do not usually require this option at the time of installation.

Then it will start the corresponding downloads. At the end you will see a message like the one below:

3.- Installing Slack using snap
3.- Installing Slack using snap

And you can run the application from the main menu. In case the shortcut is not created in the main menu you can run the application with the following command:

:~$ snap run [app_name]

Upgrade and remove applications with Snap on Ubuntu

Updating the applications with Snap is something quite simple but it has to be done periodically. To upgrade a single, just use the following command:

:~$ sudo snap refresh [app_name]

However, if you have enough installed and you want to update them with a single command, then it is convenient to run:

:~$ sudo snap refresh
4.- Upgrade snap packages
4.- Upgrade snap packages

Also, you can list all the snap applications you have, with the following command:

:~$ sudo snap list
5.- List Snap applications on Ubuntu
5.- List Snap applications on Ubuntu

This command is quite useful when you have a lot of them installed.

Remove snap packages from the system

Now, you already have a program installed, and what happens if you don’t want it anymore?

The way to uninstall snap packages is by using the following command

:~$ sudo snap remove [app_name]

It will then start the whole process and leave the computer with no trace of the program.

Now, you already have a program installed, and what happens if you do not want it anymore?

The way to uninstall snap packages is by using the following command

:~$ sudo snap remove [app_name]

It will then start the whole process and leave the computer with no trace of the program.

In this case, you will get a message similar to this:

slack removed

So, everything went well.

Snapcraft: a snap store for all

Although Snap is quite easy to handle it is a bit complicated to find certain applications. That is why a website has been created that works like a snap application store.

On the other hand, this store called snapcraft.io also gives us instructions on how to install the applications. In addition to this, it also provides us with detailed information about the package before you install it.

6.- Snapcraft
6.- Snapcraft

The above image clarifies the above. So you can search and find interesting applications to be installed by snap.

Conclusion

The technology is there to solve many problems and although Ubuntu is a very good system, it has some weaknesses for the software to be distributed. That’s why it’s betting strongly on Snap as a way to make one package work for many Linux distributions.

All of the above although it is technically quite laborious, for the users it is something easy to manipulate. Today, thanks to this post, you have learned at least the basics of handling snap on Ubuntu.

Scroll to Top