WindowsMacSoftwareSettingsSecurityAndroidProductivityLinuxPerformanceAppleConfiguration All

How to Set Up and Use Snap Packages on Ubuntu

Edited 3 weeks ago by ExtremeHow Editorial Team

SnapUbuntuSoftwareInstallationLinuxPackage ManagementApplicationsOperating SystemsSystemDesktop

How to Set Up and Use Snap Packages on Ubuntu

This content is available in 7 different language

Ubuntu is one of the world's most popular Linux distributions. It offers a user-friendly experience that even non-technical users can feel comfortable with. One of the important developments in the software management landscape on Ubuntu is Snap packages. Snap is a revolutionary packaging system designed by Canonical, the creator of Ubuntu, that provides a level of simplicity, ease of use, and security for installing software on Linux.

What are Snap packages?

Snap packages, or simply "snaps", are application containers that are packaged with all the dependencies that the software needs to run. This means that when you install a Snap package, you don't have to worry about installing additional libraries or dependencies - everything is included in one neat "snap" bundle.

Snaps are designed to work universally across a range of Linux distributions without modification. They are isolated from the rest of the system to prevent conflicts with other software and are managed by the snapd service.

Why use Snap packages?

Setting up Snap on Ubuntu

Snap support comes preinstalled on newer releases of Ubuntu, so you may already have it on your system. If not, installing Snap is easy. To verify if Snap is installed on your system, open a terminal and run:

snap --version

If the snap is installed, you will see the snap version number along with other details. If it is not installed, you can install it with the following steps:

  1. First, update your package index:
    sudo apt update
  2. Next, install the service called Snapd that manages snaps:
    sudo apt install snapd
  3. Once installed, you can log out and log in again to ensure the paths are updated.

Using Snap Packages

Now that Snap is enabled on your system, you can start using it to install, search, remove, and manage Snap packages.

Installing Snap Packages

To install a snap package, you would use the following command structure. For example, to install the popular media player vlc, you would run:

sudo snap install vlc

sudo command is necessary because installing new software usually requires administrative privileges.

Checking installed Snap packages

Once you have installed some Snaps, you will want to see a list of everything you have on your system. Use the following command to list all installed Snapchat packages:

snap list

This command will display all the snaps you have installed along with their respective version, developer name, and status.

Updating Snap Packages

As mentioned earlier, snaps are updated automatically in the background. However, if you want to make sure all your snaps are updated manually, you can force an update using the following:

sudo snap refresh

This command will refresh all snaps to their latest version.

Removing Snap packages

If you no longer need a Snap package, you can remove it. For example, to remove VLC, you would use:

sudo snap remove vlc

This command will uninstall the VLC snap package from your system.

Searching for Available Snap Packages

There is a comprehensive store of Snap applications available, called the Snap Store. Use the command below to search for a specific application in the Snap Store:

snap find <application-name>

Replace <application-name> with the name of the software you're looking for. The terminal will display a list of all matching Snap packages, with names and descriptions provided.

Advanced Snap Features

Snap offers additional features for those who want to perform more advanced tasks:

Reverting to a previous version

Snaps keep the old version when they update. If the latest version of an app isn't working as expected, it's easy to revert to the previous version:

sudo snap revert vlc

This will revert the VLC package to the previous version installed, allowing you to continue using the application without waiting for another update.

Using the Channel

Channels affect which version of a Snap package you install. The most common channels in Snap are stable, beta, candidate, and edge. For example, the following is used to install VLC from the beta channel:

sudo snap install vlc --channel=beta

When specifying a channel, keep in mind that application stability and security may vary.

Channels can be switched at any time with refresh command:

sudo snap refresh vlc --channel=stable

Controlling Snap Services

Sometimes applications can run as services, especially for server-side applications. Snap allows easy management of these services without having to go deep into configuration files:

sudo snap start <snap-name># To start a service sudo snap stop <snap-name># To stop a service sudo snap restart <snap-name># To restart a service

Replace <snap-name> with the name of the installed snap that you want to manage as a service.

Conclusion

Snap packages offer a modern approach to package management in Ubuntu and other Linux distributions. They provide an efficient and straightforward way to install applications with all their dependencies in a single bundle. Snap ensures ease of use, enhances security with sandboxing, and provides seamless automatic updates to keep your applications up to date with minimal effort.

By adopting Snap technology, you can gain access to a wide variety of software, with easy access to both stable and cutting-edge versions. It streamlines the experience and is fast becoming an integral part of Ubuntu's software ecosystem. Whether you are a casual user, developer, or administrator, Snap packages improve the way you manage software on your Ubuntu system.

If you find anything wrong with the article content, you can


Comments