Site icon CentLinux

How to install Snap on Linux 9 | Ultimate Guide

Share on Social Media

Learn how to easily install Snap on Linux 9 with step-by-step instructions. Get started with Snap packages for streamlined software management on your Linux system. #centlinux #linux #snapstore

What is Snap?

Snap is a software packaging and deployment system, developed by Canonical for operating systems that use the Linux kernel and the systemd init system. The packages, called snaps, and the tool for using them, snapd, work across a range of Linux distributions and allow upstream software developers to distribute their applications directly to users. Snaps are self-contained applications running in a sandbox with mediated access to the host system. Snap installation tool was originally released for cloud applications but was later ported to also work for Internet of Things devices and desktop applications.

Snaps are packaged with all their dependencies to run on all popular Linux distributions from a single build. They update automatically and roll back gracefully.

Snaps are discoverable and installable from the Snap Store, an app store with an audience of millions.

Features of Snap Installation Tool

Some of the most popular features of Snap software are:

Snap vs YUM

Snap and YUM are both package management systems used in Linux distributions, but they serve different purposes and have distinct features:

  1. Purpose:
  1. Packaging Format:
  1. Installation and Management:
  1. Distribution Support:

In summary, Snap and YUM are both valuable tools for managing software packages on Linux systems, but they serve different purposes and excel in different areas. Snap offers cross-distribution compatibility, sandboxing, and ease of use, while YUM is tailored for RPM-based distributions with a focus on package management.

Environment Specification

We are using a virtual machine with minimal Rocky Linux 9 OS with following specifications.

Prepare your Linux Server

By using a ssh tool, login as root user on your Rocky Linux server.

Execute dnf command to update software packages in your Linux OS.

# dnf update -y

Snap installation tool is available in EPEL (Extra Packages for Enterprise Linux) yum repository. Therefore, you should install it now by executing following command.

# dnf install -y epel-release

EPEL repository is dependent upon CRB (CodeReady Builder) yum repository. Therefore, you need to enable CRB before starting to install Snap on Linux.

# /usr/bin/crb enable
Enabling CRB repo
CRB repo is enabled and named: crb

Rebuild your cache for newly installed yum repositories.

# dnf makecache
Extra Packages for Enterprise Linux 9 - x86_64  515 kB/s |  15 MB     00:30
Rocky Linux 9 - BaseOS                          816  B/s | 4.1 kB     00:05
Rocky Linux 9 - AppStream                       857  B/s | 4.5 kB     00:05
Rocky Linux 9 - CRB                             372 kB/s | 2.1 MB     00:05
Rocky Linux 9 - Extras                          737  B/s | 2.9 kB     00:04
Metadata cache created.

All required yum repositories has been setup. Now, you can easily install snap installation tool.

Install Snap on Linux

To setup Snap installation tool on your Linux OS, you need to install snapd software package.

Search for snapd by using dnf command.

# dnf search snapd
Last metadata expiration check: 0:00:30 ago on Sat 13 May 2023 08:11:20 PM PKT.
========================= Name Exactly Matched: snapd ==========================
snapd.x86_64 : A transactional software package manager
======================== Name & Summary Matched: snapd =========================
snapd-devel.noarch : Development files for snapd
snapd-glib.x86_64 : Library providing a GLib interface to snapd
snapd-glib-devel.x86_64 : Development files for snapd-glib
snapd-glib-tests.x86_64 : Installed tests for snapd-glib
snapd-qt.x86_64 : Library providing a Qt5 interface to snapd
snapd-qt-devel.x86_64 : Development files for snapd-qt
snapd-qt-qml.x86_64 : Library providing a Qt5 QML interface to snapd
snapd-qt-tests.x86_64 : Installed tests for snapd-qt
snapd-selinux.noarch : SELinux module for snapd

Install snapd software package by executing following command.

# dnf install -y snapd

Enable and start snapd.socket by running following command at Linux terminal.

# systemctl enable --now snapd.socket
Created symlink /etc/systemd/system/sockets.target.wants/snapd.socket → /usr/lib/systemd/system/snapd.socket.

To enable classic snap support, enter the following to create a symbolic link between /var/lib/snapd/snap and /snap directories.

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

Snap environment variables are not set for your current session. Therefore, obtain a new Linux Bash shell by using su command.

# su -

Install Snap Store on Linux

To install Snap store on Linux, simply run the following command at Linux terminal.

# snap install snap-store
snap-store 41.3-71-g709398e from Canonical✓ installed

To get the list of installed snaps, you can execute following command.

# snap list
Name               Version           Rev    Tracking       Publisher        Notes
snap-store         41.3-71-g709398e  959    latest/stable  canonical✓       -

You can get more details about a snap as follows.

# snap info snap-store
name:    snap-store
summary: Snap Store is a graphical desktop application for discovering,
  installing and managing snaps on Linux.
publisher: Canonical✓
store-url: https://snapcraft.io/snap-store
contact:   https://bugs.launchpad.net/snap-store/
license:   unset
description: |
  Snap Store showcases featured and popular applications with useful
  descriptions, ratings, reviews and screenshots.


  Applications can be found either through browsing categories
  or by searching.


  Snap Store can also be used to switch channels, view and alter snap
  permissions and view and submit reviews and ratings.


  Snap Store is based on GNOME Software, optimized for the Snap experience.
commands:
  - snap-store
  - snap-store.ubuntu-software
  - snap-store.ubuntu-software-local-file
snap-id:      gjf3IPXoRiipCu9K0kVu52f0H56fIksg
tracking:     latest/stable
refresh-date: today at 22:26 PKT
channels:
  latest/stable:     41.3-71-g709398e 2023-04-28 (959) 12MB -
  latest/candidate:  41.3-71-g709398e 2023-04-27 (959) 12MB -
  latest/beta:       ↑
  latest/edge:       41.3-71-g709398e 2023-03-29 (959) 12MB -
  preview/stable:    –
  preview/candidate: 0.2.7-alpha      2023-02-02 (864) 10MB -
  preview/beta:      ↑
  preview/edge:      0.2.9-alpha      2023-05-09 (965) 10MB -
installed:           41.3-71-g709398e            (959) 12MB -

To update all installed snaps, you can execute following command at Linux terminal.

# snap refresh
All snaps up to date.

Video Tutorial: How to install Snap on Linux

Final Thoughts

Mastering how to install Snap on Linux 9, opens the door to a vast array of software possibilities. With Snap’s streamlined package management, accessing and managing applications becomes a breeze. Whether you’re a developer or an everyday user, embracing Snap empowers you with a versatile toolset for your Linux experience. If you are new to Linux command-line, then we strongly recommend that you should attend online training: Linux command line for beginners

Exit mobile version