How to Install Snap & Snap-Store (Snapcraft) on Fedora 35

By default, Fedora 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 Fedora-based systems that are currently actively supported. There are a few conflicts with specific packages. The issue with Snaps VS DNF package manager is that Snaps are self-contained, which results in an increased .snap due to having all its dependencies included along with various degrees of slight performance degradation compared to a natively installed application. In contrast, DNF 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 Fedora 35.

Prerequisites

  • Recommended OS: Fedora Linux 35
  • User account: A user account with sudo or root access.

Update Operating System

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

sudo dnf upgrade --refresh -y

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@fedora ~]$ sudo whoami
root

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

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

su

Install Dependencies Required

Before you proceed with the installation, run the following command to install or check that the following packages on your Fedora desktop.

sudo dnf install dnf-plugins-core fuse squashfuse -y
Advertisement

Install Snapcraft (Snapd)

Snapcraft, also known as Snap or Snapd, is available to be installed from Fedora’s default repository, and the package is named snapd.

To begin the Snap installation, run the following command.

sudo dnf install snapd

Example output:

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

Next, some packages come in classic, so you will 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 from Canonical✓ installed

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

systemctl status snapd

Example:

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

sudo systemctl start snap

To enable Snap when restarting your operating system, use the following command:

sudo systemctl enable snap

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.

Advertisement

Optional – Install Snap-Store

After you have installed Snap on your Fedora 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:

Troubleshooting – Snap Icons Missing

Currently, on Fedora 35, 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

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.

Advertisement

Remove Snap (From Fedora 35)

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

sudo dnf autoremove snapd -y

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 Fedora 35 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 DNF.

Home users who find installing applications challenging on Fedora 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