Package management is an essential section of the Linux community. There has been a lot of evolvement in this field with different tools being developed to help in software packaging and distribution. Snap is a new package manager for Linux systems that was developed by Canonical; well known for developing Ubuntu operating system. Note that snap can be installed on a range of Linux distributions and allow software developers to distribute their built applications to end-users. Snaps are standalone packages containing required dependencies and run independently while on a Linux system. In this guide, we will learn more about Snap, and how to install and use it on Solus operating system.

Terms in Snap Package Management

  • Snapd(Snap Daemon): The background service(daemon) which manages snaps. It downloads snaps from the store, mounts them, and runs applications out of the snaps. Snapd uses a snap command for users to request a snap or package to be installed.
  • Snap: It is the application package format and the CLI(Command-Line Interface) tool used to install and remove snaps. Each snap package has its set of dependencies and libraries.
  • Snapcraft: A framework where developers are free to build snaps.
  • Snap store: A platform for sharing snaps; users can search, download and install snaps from the snap store.

Installing Snapd and Use snap on Solus Linux

Ensure by Solus repositories are up to date by upgrading them using this command:

sudo eopkg up

Then reboot your Solus system.

sudo reboot

Install Snap on Solus Linux

If you want to use snap package manager on Solus, then you must install snapd first. Enter this command on the terminal.

sudo eopkg install snapd

Output after installation of Snapd

Total size of package(s): 9.46 MB
Downloading 1 / 1
Package snapd found in repository Solus
snapd-2.53.4-67-1-x86_64.eopkg (9.5 MB)100%    514.39 KB/s [00:00:17] [complete]
Installing 1 / 1
snapd-2.53.4-67-1-x86_64.eopkg [cached]

Enable and start snapd service

Once snapd has been installed successfully, enable the systemd unit which is meant for managing the main snap communication socket.

systemctl enable --now snapd.socket

Results after enabling snapd. socket.

Created symlink /etc/systemd/system/sockets.target.wants/snapd.socket → /usr/lib/systemd/system/snapd.socket.

Check if the snapd.socket is active.

$ systemctl is-active snapd.socket
active

To see the status of the snaps. socket, apply this command.

$ systemctl status snapd.socket

● snapd.socket - Socket activation for snappy daemon
     Loaded: loaded (/usr/lib/systemd/system/snapd.socket; enabled; vendor pres>
     Active: active (listening) since Sat 2022-04-30 23:23:05 EAT; 31min ago
   Triggers: ● snapd.service
     Listen: /run/snapd.socket (Stream)
             /run/snapd-snap.socket (Stream)
      Tasks: 0 (limit: 4647)
     Memory: 0B
        CPU: 332us
     CGroup: /system.slice/snapd.socket

Apr 30 23:23:05 solus systemd[1]: Starting Socket activation for snappy daemon.>
Apr 30 23:23:05 solus systemd[1]: Listening on Socket activation for snappy dae>

Check if the snapd.socket is enabled and will work according to the use of this code.

$ systemctl is-enabled snapd.socket
enabled

Verify Snap Version

After installing a snap, you can check the version.

$ snap --version
snap    2.53.4
snapd   2.53.4
series  16
solus   4.3
kernel  5.15.32-213.current

Reboot your Solus System and start using snap.

sudo reboot -i

Installing Snap Packages on Solus Linux

Snap can be used to perform certain activities in Solus such as searching, installing, and removing packages. Let’s start by finding an application from the snap store and installing it into our operating system.

snap find

For instance, in this guide, we will install any gaming application. Start by checking whether it exists in the snap store.

snap find "games"

Here are some of the games that exist in the snap store. From the list that appears, you can look for the application you want to install.

$ snap find "games"
Name                    Version                 Publisher             Notes    Summary
gamescore               1.0.2                   mvo                   -        Gamescore is a system to display and edit the score of a sports game.
0ad                     0.0.25b-alpha           play0ad✓              -        Real-time strategy game of ancient warfare
mumble                  1.3.4                   snapcrafters          -        Mumble is an open source, low-latency, high 
telegram-desktop        3.7.3                   telegram.desktop      -        Fast. Secure. Powerful.
solitaire               1.1                     1bsyl                 -        usual Solitaire card game, as known as 
sudoku-game             1.1                     1bsyl                 -        Sudoku 9x9 game
molden                  6.2                     linuxcoffee           -        Molden is a package for displaying Molecular Density.

In this case, let’s use the sudoku game as an example. You can check more information regarding the snap before you install it.

snap info sudoku-game

The command above will give you this output on the Sudoku game with details about this gaming application.

$ snap info sudoku-game
name:      sudoku-game
summary:   Sudoku 9x9 game
publisher: Sylvain Becker (1bsyl)
store-url: https://snapcraft.io/sudoku-game
contact:   http://www.1bsyl.com/www/Sudoku.php
license:   Proprietary
description: |
  The object is to fill empty cells with numbers between 1 and 9, so that number should appear only
  once on each row, column and region.
snap-id: XKJBpAidfjnXmq06WLJPqSCi0CaDMf7D
channels:
  latest/stable:    1.1 2020-12-15 (2) 42MB -
  latest/candidate: 1.0 2017-05-17 (1)  9MB -
  latest/beta:      1.0 2017-05-17 (1)  9MB -
  latest/edge:      1.0 2017-05-17 (1)  9MB -

Go ahead and install sudoku using snap.

sudo snap install sudoku-game

Soduku-game will be installed successfully on Solus.

sudoku-game 1.1 from Sylvain Becker (1bsyl) installed

Managing Snaps on Solus Linux

There are several things you can do when snaps are installed.

View Version

To check the version of the installed snaps, apply the following command.

snap list

For a specific snap, add the name of the application after the above command.

snap list sudoku-game

The version will be displayed.

$ snap list sudoku-game
Name         Version  Rev  Tracking       Publisher  Notes
sudoku-game  1.1      2    latest/stable  1bsyl      -

Updating Snaps

Snap has the capability of updating the available snaps to the latest versions. This command updates all the available snaps.

sudo snap refresh --list

To update a specific snap, add the particular name of the package. Here is an example.

sudo snap refresh sudoku-game

In this case, the Sudoku game is up to date. If there is a newer version, it will update.

snap "sudoku-game" has no updates available

Reverting Snaps

With a snap, you can use the revert command to get back to the previous version of the application, especially after an update.

sudo snap revert sudoku-game

If there is no previous version, you will get this feedback.

$ sudo snap revert sudoku-game
error: cannot revert "sudoku-game": no revision to revert to

Disabling and Enabling Snaps

If you do not want to use a snap, you can disable it and later enable it when you want to use it.

Disabling

sudo snap disable sudoku-game

The sudoku game will be disabled.

$ sudo snap disable sudoku-game
sudoku-game disabled

Enabling

sudo snap enable sudoku-game

Sudoku game will be enabled.

$ sudo snap enable sudoku-game
sudoku-game enabled

Uninstalling Snaps

To get rid of a snap, you can remove it from Solus using this command.

sudo snap remove sudoku-game

The snap will be uninstalled successfully.

$ sudo snap remove sudoku-game
sudoku-game removed

Removing Snapd

If you want snapd utility out of your Solus system, uninstall it. Below is the command you will use.

sudo eopkg autoremove --purge snapd

Snapd will be removed successfully.

$ sudo eopkg autoremove --purge snapd
The following list of packages will be removed
in the respective order to satisfy dependencies:
snapd 
Removing package snapd
Removed snapd

Conclusion

Snap is a crucial tool to have in your Solus system. From this article, we have seen the different ways Snap will help us manage our packages. It is possible to install, update and delete applications with the help of Snap. Not much work is required since with the package existing in the snap store, it is absolutely easy to install it on your computer using snap. Feel free to try out snap package manager on your Solus system.

More Guides:

LEAVE A REPLY

Please enter your comment!
Please enter your name here