How to Install Snap & Snap-Store (Snapcraft) on Debian 11 Bullseye

By default, Debian does not come with Snap or Snap Store installed as this is a feature that was built by developed by Canonical as a faster and easier way to get the latest versions of software installed on Ubuntu systems, and Snap packages are installed from a central SNAP server operated by Canonical.

Given that Ubuntu is based on Debian, Snap can be installed and, for the most part, work with most packages. There are a few conflicts with specific packages, especially when Debian spits out a new release, luckily Debian stable releases are few and far between. The issue with Snaps VS APT package manager is that Snaps are self-contained, which results in an increased .snap due to having all its dependencies included. In contrast, APT is much lighter than its snap counterpart because it doesn’t need to bundle dependencies.

However, some advantages of using snap packages are that they are more frequently up to date than APT packages, especially on distributions such as Debian, which is incredibly stable. However, this comes with drawbacks of older packages/software. Another advantage is that you can install the same package alongside .deb packages from APT when installing Snap packages since they will not cause any conflicts and can be handy in certain situations.

Installing Snap in Debian 11 Bullseye is quite a straightforward process. You will learn how to install Snap and Snap-Store on Debian 11 Bullseye by the end of the tutorial.

Prerequisites

  • Recommended OS: Debian 11 Bullseye
  • User account: A user account with sudo privilages or root access (su command).
  • Required Packages: 

Updating Operating System

Update your Debian 11 operating system to make sure all existing packages are up to date:

sudo apt update && sudo apt upgrade

Root or Sudo Access

By default, when you create your account at startup with Debian compared to other distributions, it does not automatically receive sudoers status. You must either have access to the root password to use the su command or visit our tutorial on How to Add a User to Sudoers on Debian.

Install Snap (Snapd)

Snap is available to be installed from Debian 11’s default Repository, and the package is named snapd.

To begin the Snap installation, run the following command.

sudo apt install snapd

Example output:

How to Install Snapcraft (Snap) on Debian 11 Bullseye

Type “Y,” then press “ENTER KEY” to proceed with the installation.

Once Snap is installed, it is highly recommended to log out and back in again or restart your service to ensure snap’s paths are updated correctly.

sudo systemctl restart snapd

If you are installing Snap for the first time, it is advised to install the core files to avoid conflicting issues:

sudo snap install core

Example output:

core 16-2.51.4 from Canonical✓ installed

Next, verify the Snapd service is running by using the systemctl command:

systemctl status snapd

Example:

How to Install Snap & Snap-Store (Snapcraft) on Debian 11 Bullseye

If the service has not been activated, use the following command to start Snap.

sudo systemctl start snap

To enable Snap on system boot, use the following command:

sudo systemctl enable snap

How to use Snap

Install a Package

Now that Snap is installed, you can quickly test installing a package, and this can be anything; however, for the tutorial, the Discord application will be the example.

sudo snap install discord

Example output:

discord 0.0.16 from Snapcrafters installed

Update Packages

For the future, to update Discord and any other packages installed by Snap, run the following command:

sudo snap refresh

Remove Packages

If you no longer need to have Discord installed, remove it using the Snap remove command.

sudo snap remove discord

Example output:

discord removed

Discord works well with Snap and Snap Store; however, as mentioned at the start, some applications can be problematic, such as not adding icons to the application menu. If this occurs, check the troubleshooting section at the end of the tutorial.

Optional – Install Snap-Store

After you have installed Snap on your Debian system, you do have the option to install the Snapcraft store, which uses a graphical UI that can be more appealing and easier to search for packages. This is entirely optional, but if you want to install, run the following command:

sudo snap install snap-store

Example output:

snap-store 3.38.0-64-g23c4c77 from Canonical✓ installed

With the install complete, you can run Snap Store in a few different ways.

First, while you are in your terminal, you can use the following command:

snap run snap-store

Alternatively, run the snap run snap-store & command in the background to free up the terminal:

snap run snap-store &

However, this isn’t practical, and you would use the following path on your desktop to open with the path: Activities > Show Applications > Snap Store. If you cannot find it, use the search function in the Show Applications menu if you have many applications installed.

Example:

How to Install Snap & Snap-Store (Snapcraft) on Debian 11 Bullseye

Once open, you will hit the Snap Store landing store page. From here, you can search and install Snap packages of your choosing.

Example:

How to Install Snap & Snap-Store (Snapcraft) on Debian 11 Bullseye

Troubleshooting – Snap Icons Missing

Currently, on Debian 11, Snap, for the most part, works with most packages. However, on some occasions, applications do not have their icon added to the system app launcher. This can be fixed with the procedure below.

First, run the following command ln -s command:

sudo ln -s /etc/profile.d/apps-bin-path.sh /etc/X11/Xsession.d/99snap

Next, use a text editor to open the file login.defs:

sudo nano /etc/login.defs

Once inside the file, paste the following code at the end of the file.

ENV_PATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

Example:

How to Install Snap & Snap-Store (Snapcraft) on Debian 11 Bullseye

Next, save the file CTRL+O then exit with CTRL+X.

To make the fixes live, you will need to log out and log back in. However, it’s best to restart the system.

sudo reboot now

When you log back into the system, the missing icons should appear.

Remove Snap (From Debian)

To remove Snap off your Debian system, run the following command:

sudo apt autoremove snapd --purge

Example output:

How to Install Snap & Snap-Store (Snapcraft) on Debian 11 Bullseye

Type “Y,” then press “ENTER KEY” to proceed with the uninstall (removal). 

This will remove Snap and any additional packages installed and dependencies. For example, if you installed Snap Store and did not remove it prior, this package and any others installed by Snap in full.

Example:

Removing snap snapcraft and revision 6751
Removing snap-snapcraft-6751.mount
Discarding preserved snap namespaces
Final directory cleanup
Removing extra snap-confine apparmor rules
Removing snapd cache
Removing snapd state

Comments and Conclusion

In the tutorial, you have learned how to install on Debian 11 Bullseye Canonical’s Snap system and install, update, and remove packages. Overall, the adaption of using Snap packages seems to split users down the middle. Most sysadmins and power users will not touch Snaps; however, more desktop and casual users enjoy the ease of installing and having updated packages and don’t mind the bloat in space. Given how big SSD hard drives are these days, the difference is pretty minor unless you have limited resources such as a production server. Home users who find installing applications challenging on Debian should check out Snap to save some time and frustration while learning the system.



Follow LinuxCapable.com!

Like to get automatic updates? Follow us on one of our social media accounts!