How To Setup snapd in Linux for Installing Snaps

Overview

A snap package is one of the various application formats available for installing and running software in Linux. This guide shows how to install snapd in Linux for installing snaps.

Snaps are modern and secure universal applications for Linux. A snaps applications packaged with all their dependencies are self-contained, allowing users to install them on any Linux system without additional dependencies. Snaps are also updated automatically, thus ensuring that users have the latest version of an app.

Main components in the snaps ecosystem
  • Snap – a snap is a universal packaging format that bundles an app and its dependencies so that it can run across Linux distributions,
  • Snapd – snapd is a daemon(or background service) that manages and maintains snaps on a Linux system, automatically,
  • Snap Store – the Snap Store is a central repository where developers can upload their snaps, and Linux users can browse to find their favorite apps and install them, and
  • Snapcraft – is a command-line tool used to build and publish snaps.
What are the key benefits of using snaps?
  • Snaps are universal – Snaps run on any Linux distribution, including Debian, Ubuntu, Linux Mint, Fedora, and Arch Linux,
  • Snaps are secure – Snaps are sandboxed, so they cannot access your system files or other snaps. This makes them more secure than traditional Linux packages,
  • Snaps update automatically – Snaps are updated automatically, so you always have the latest version of your apps, and
  • Snaps are discoverable – Snaps are available in the Snap Store, which makes it easy to find and install them.
More on the Security of Snaps

Snaps are built to be secure by default. When you install a snap package, it operates in a “sandboxed” environment, which means it is isolated from the rest of the system and cannot access resources or data outside of the designated area. This helps to keep viruses and other dangerous software from wreaking havoc on the rest of the system.

Furthermore, snap packages are digitally signed by their publishers, so you can be confident that the package they are installing is from a reliable source. Snap packages are also subjected to automated and manual security checks before they are published to the official Snap Store, which helps to assure their security.

Installing snapd in Linux

Before you can start using snaps on your Linux system, you need to install snapd as shown below. Run the appropriate group of commands to install and set up snapd on your Linux distribution.

Note: Snapd comes preinstalled in newer versions of Ubuntu.

Older versions of Ubuntu
$sudo apt update
$sudo apt install snapd
On Linux Mint
$sudo rm /etc/apt/preferences.d/nosnap.pref
$sudo apt update
$sudo apt install snapd
On elementary OS
$sudo apt update
$sudo apt install snapd
On Kubuntu
$sudo apt update
$sudo apt install snapd
On KDE Neon
$sudo apt update
$sudo apt install snapd
On Pop!_OS
$sudo apt update
$sudo apt install snapd
On Debian
$sudo apt update 
$sudo apt install snapd 
$sudo snap install core
On Fedora
$sudo dnf install snapd
$sudo ln -s /var/lib/snapd/snap /snap
On RHEL 8/7/9
$sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm  #RHEL 9
$sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm  #RHEL 8
$sudo rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm  #RHEL 7
$sudo dnf upgrade
$sudo subscription-manager repos --enable "rhel-*-optional-rpms" --enable "rhel-*-extras-rpms"
$sudo yum update
$sudo yum install snapd
$sudo systemctl enable --now snapd.socket
$sudo ln -s /var/lib/snapd/snap /snap
On CentOS
$sudo yum install epel-release
$sudo yum install snapd
$sudo systemctl enable --now snapd.socket
$sudo ln -s /var/lib/snapd/snap /snap
On openSUSE
$git clone https://aur.archlinux.org/snapd.git
$cd snapd
$makepkg -si
$sudo systemctl enable --now snapd.socket
$sudo ln -s /var/lib/snapd/snap /snap

On Manjora Linux
$sudo pacman -S snapd
$sudo systemctl enable --now snapd.socket
$sudo ln -s /var/lib/snapd/snap /snap
On Rasbian
$sudo apt update
$sudo apt install snapd
$sudo reboot
$sudo snap install core
Installing a Snap Package in Linux

After installing snapd on your system, you may use the snap command to install a snap application. This example demonstrates how to install Postman – an API development environment:

$sudo snap install postman

Run this command to see more snap command-line options:

$snap -h
OR
$man snap
Conclusion

In this guide, I’ve explained the snap universal package format, and how to install snapd in a Linux system so that you can install and use snaps. The comment section is right below, use it to provide us with any feedback.

For more information, visit Snapcreaft: https://snapcraft.io/

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

Page Contents