How to Install Snap & Snap-Store (Snapcraft) on openSUSE Leap 15

By default, openSUSE 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.

Snap can be installed and, for the most part, work with most packages on openSUSE-based systems that are currently actively supported. There are a few conflicts with specific packages. The issue with snaps VS zypper package manager is that Snaps are self-contained, resulting in an increased .snap due to having all its dependencies included and various degrees of slight performance degradation compared to a natively installed application. In contrast, the zypper is much lighter than its snap counterpart because it doesn’t need to bundle dependencies.

In the following tutorial, you will learn how to install Snapcraft and have the ability to use this feature going forward in openSUSE Leap 15.

Prerequisites

Update Operating System

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

sudo zypper refresh

The tutorial will be using the sudo command and assuming you have sudo status.

To verify sudo status on your account:

sudo whoami

Example output showing sudo status:

[joshua@opensuse ~]$ sudo whoami
root

To set up an existing or new sudo account, visit our tutorial on adding a User to Sudoers on openSUSE.

To use the root account, use the following command with the root password to log in.

su
Advertisement

Install Snapcraft (Snapd)

To install Snap, you first need to import the snappy repository for your version of openSUSE Leap. Some examples are below.

Import snappy repository for openSUSE 15.2:

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

Import snappy repository for openSUSE 15.3:

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

This will change. However, replace the 15. x with the newer version number in time, it is that easy.

Now import the GPG keys required:

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

With the repository and GPG key added, refresh the cache to include the new snappy repository.

sudo zypper dup --from snappy

Next, install the snapd package on openSUSE:

sudo zypper install snapd

Example output:

How to Install Snap & Snap-Store (Snapcraft) on openSUSE Leap 15

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

Once Snap is installed, it is required to reboot your system.

sudo reboot

When you have returned to your system, start the snapd service and enable automatic startup.

sudo systemctl enable snapd --now

Next, some packages come in classic, so you need to create a symlink to enable classic snap support.

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

When 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.52.1 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 openSUSE Leap 15

How to Use Snapcraft (Snapd)

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.

On the odd occasion, the application icon can not appear in the activities > show applications menu. Reboot the system as this fixes the majority of these bugs typically if they occur.

Advertisement

Optional – Install Snap-Store

After you have installed Snap on your openSUSE Leap 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 openSUSE Leap 15

Once open, you will need to wait several seconds while the Snap Store cache downloads.

The final look…

How to Install Snap & Snap-Store (Snapcraft) on openSUSE Leap 15

How to Remove Snap (From openSUSE Leap 15)

To remove Snap from your system, run the following command:

sudo zypper remove snapd

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
Advertisement

Comments and Conclusion

In the tutorial, you have learned how to install on openSUSE 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. Still, due to being in a separate container, Snaps can run slower in performance than an application installed natively through zypper.

Home users who find installing applications challenging on openSUSE or even using Flatpack should check out Snap to save some time and frustration while learning the system. It’s an easy-to-understand method.

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x