HomeARCHHow to Install and Use Snapd on Linux

How to Install and Use Snapd on Linux

Welcome to this guide today on how to install and use Snapd on Linux. Package managers are software tools that are used to manage software packages (also known as dependencies) on a system. A package manager simplifies the process of installing, updating, and removing software packages by automating these tasks and ensuring that all dependencies are properly handled. Package managers are widely used in Unix-like operating systems such as Linux and macOS, as well as in programming languages such as Python, Node.js, and Ruby. Some popular package managers include APT and dpkg for Debian-based Linux systems, Homebrew for macOS, and Pip for Python packages.

With time, the traditional package formats such as .deb and .rpm are slowly fading away as people are shifting to independent package formats. The independent package formats are often designed to be platform-independent and self-contained, making it easier for developers to share and distribute their code. This brings several package managers such as Snapd, Flatpak and AppImage into play.

Today, we will learn how to install and use snapd on Linux.

What is Snapd?

Snap, also called snappy is a distribution-independent package format developed by Canonical. Snap was originally developed for Ubuntu systems in 2014, but with time, it was adopted by other distributions such as CentOS, Fedora, Linux Mint, Gentoo, Arch e.t.c

The main goal of this project was to create a single unified format for software packages that can run on a variety of devices. With Snap, users can access SnapCraft (an online app store) where they can find and install software packages.

The amazing features and benefits offered by Snapd are:

  • Automatic updates: It automatically updates installed snaps to the latest version, ensuring that users have access to the latest features and bug fixes.
  • Isolation: snapd uses containerization to isolate snaps from the host system, reducing the risk of conflicts with other software installed on the system.
  • Rollback: snapd allows users to easily roll back to a previous version of a snap if there are issues with the latest version.
  • Security: It uses various security mechanisms to ensure that snaps are safe to use, including confinement, sandboxing, and secure file permissions.
  • Multi-distribution support: It is designed to work across multiple Linux distributions, allowing developers to distribute their software to a wider audience.
  • Easy installation: snapd makes it easy to install snaps from the Snap Store, a centralized repository of snap packages.
  • Dependency resolution: It automatically resolves and installs any required dependencies for a snap package.
  • Parallel installations: It allows multiple versions of a snap to be installed in parallel, allowing users to easily test and compare different versions of a package.

Install and Use Snapd on Linux

The following steps will take you to how to install Snapd on Linux.

Step 1 – Update your Linux System

Before we commence the installation, it is important to update your Linux system.

##On Debian/Ubuntu
sudo apt update && sudo apt upgrade-y

##On Rhel/Rocky Linux/Alma Linux/CentOS/Fedora
sudo yum update

Once the system and the available packages have been updated, proceed shown below.

#1. Install Snapd on Ubuntu|Debian|Kali Linux

To install Snapd on Ubuntu|Debian|Kali Linux use the command:

sudo apt install -y snapd

Once installed, ensure that Snapd is started and enabled.

sudo systemctl enable snapd.socket snapd apparmor
sudo systemctl start snapd.socket snapd apparmor

#2. Install Snapd On CentOS|Rocky Linux|Alma Linux

Snapd can be installed on CentOS|Rocky Linux|Alma Linux (8/9) using the below steps.

First, enable the EPEL repository on the system:

sudo yum install epel-release -y

Now you can install Snapd by executing the command:

sudo dnf -y install snapd

Start and enable the service:

sudo systemctl enable --now snapd.socket

Create the below symbolic link for classic snap support:

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

#3. Install Snapd On CentOS 7

It is also possible to install Snapd On CentOS 7. First, enable the EPEL repository:

sudo yum install epel-release -y

Once installed, install the copr yum plugin.

sudo yum install yum-plugin-copr

Now add the snapd repo using the command:

sudo yum copr enable ngompa/snapcore-el7

Now install snapd on CentOS 7:

sudo yum -y install snapd

Start and enable the service:

sudo systemctl enable --now snapd.socket

Create a symbolic link for classic snap support:

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

#4. Install Snapd On Arch Linux|Manjaro

Snapd can be installed on Arch Linux|Manjaro using the pacman manager as shown:

sudo pacman -S snapd

You can also use yay AUR helper as shown:

yay -S --noconfirm --needed snapd

It is also possible to clone and install snapd manually:

git clone https://aur.archlinux.org/snapd.git
cd snapd
makepkg -si

Once installed, start and enable the service:

sudo systemctl enable --now snapd.socket

Create a symbolic link for classic snap support:

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

You also need to export the PATH as shown:

echo "export PATH=\$PATH:\/snap/bin/" | sudo tee -a /etc/profile
source /etc/profile

#5. Install Snapd On OpenSUSE Linux

To install Snapd On OpenSUSE, first add the repository with the command:

sudo zypper addrepo --refresh \
    https://download.opensuse.org/repositories/system:/snappy/openSUSE_Leap_15.3 \
    snappy

You need to replace openSUSE_Leap_15.3 with the exact OpenSUSE version before you proceed to import the GPG keys:

sudo zypper --gpg-auto-import-keys refresh

Update your package cache:

sudo zypper dup --from snappy

Install Snapd on SUSE with the command:

sudo zypper install snapd

Export your PATH and source your profile:

echo "export PATH=\$PATH:\/snap/bin/" | sudo tee -a /etc/profile
source /etc/profile

Now start and enable the services:

sudo systemctl enable --now snapd
sudo systemctl enable --now snapd.apparmor

#6. How to Use Snapd On Linux

Once Snapd has been installed on your system, you proceed to install and manage the packages. To find a package, use the command with the below syntax:

snap find <package name>

Replace the package name appropriately. For example:

$ snap find telegram-desktop
Name              Version  Publisher          Notes  Summary
telegram-desktop  4.6.5    telegram-desktop  -      Fast. Secure. Powerful.

Once identified, proceed and install it:

$ sudo snap install telegram-desktop
telegram-desktop 4.6.5 from Telegram FZ-LLC (telegram-desktop) installed

You can launch the application with two methods. First, from the command line:

snap run telegram-desktop

The second method is from the App Menu

To see all installed snap packages:

$ snap list
Name               Version                     Rev    Tracking       Publisher          Notes
bare               1.0                         5      latest/stable  canonical         base
core18             20230320                    2721   latest/stable  canonical         base
core22             20230325                    607    latest/stable  canonical         base
gnome-3-28-1804    3.28.0-19-g98f9e67.98f9e67  194    latest/stable  canonical         -
gtk-common-themes  0.1-81-g442e511             1535   latest/stable  canonical         -
snapd              2.58.3                      18596  latest/stable  canonical         snapd
teams-for-linux    1.0.55                      300    latest/stable  ismaelmartinez     -
telegram-desktop   4.6.5                       4654   latest/stable  telegram-desktop  -

To see available snapd package updates, use the command:

sudo snap refresh --list

Then update the desired packages:

sudo snap refresh <package name>

To uninstall the package, run:

sudo snap remove <package name>

Conclusion

Today, we have systematically walked through how to install and use Snapd on Ubuntu, Debian, Rocky Linux, Alma Linux, OpenSUSE, Arch Linux, etc. I hope this was helpful.

See more guides:

Klinsmann Öteyo
Klinsmann Öteyo
Self proclaimed Geek
- Advertisment -

Recent posts

LEAVE A REPLY

Please enter your comment!
Please enter your name here