Posted on
Administration

Using snapd on RHEL and openSUSE

Author
  • User
    Linux Bash
    Posts by this author
    Posts by this author

Leveraging Snap Packages Across Linux Distributions: A Guide for RHEL and openSUSE Users

In the world of Linux, application distribution is predominantly managed through package managers. Standard repositories of popular Linux distributions like RHEL (Red Hat Enterprise Linux) and openSUSE often provide a wealth of software packages. However, they may not always contain the latest version of an app, and this is where Snap comes into play.

What is Snap?

Snap is a universal packaging system developed by Canonical, the company behind Ubuntu. It allows software vendors to distribute their applications in a complete, isolated package with all the dependencies, ensuring consistent performance across multiple Linux distributions. Today, we will explore how to use snapd, the service enabling the use of Snap packages, on two major Linux distributions: RHEL and openSUSE.

Installing snapd on RHEL

  1. Enable the Extra Packages for Enterprise Linux (EPEL) Repository: Since snapd is available in the EPEL repository, the first step for RHEL users is to enable EPEL:

    sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
    
  2. Install snapd: Once EPEL is enabled, you can install snapd using the dnf package manager:

    sudo dnf install snapd
    
  3. Enable and Start the snapd Service: After installation, enable and start the snapd service:

    sudo systemctl enable --now snapd.socket
    

    To ensure classic snap support, create a symbolic link:

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

Now, RHEL users can install Snap packages using the command sudo snap install <packagename>.

Installing snapd on openSUSE

The process for openSUSE users is quite similar but uses the zypper package manager.

  1. Add the Snap Repository: First, you need to add the snap repository:

    sudo zypper addrepo --refresh https://download.opensuse.org/repositories/system:/snappy/openSUSE_Leap_15.2 snappy
    
  2. Install snapd: Then, use zypper to install snapd:

    sudo zypper install snapd
    
  3. Enable and Start the snapd Service: Like with RHEL, you need to enable and start the service:

    sudo systemctl enable --now snapd
    sudo systemctl start snapd
    

    Again, creating a symbolic link ensures compatibility:

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

With these steps, openSUSE users can use the sudo snap install <packagename> to install Snap packages.

Using Snap Packages

Once snapd is installed, using Snap packages is straightforward. Here’s how you can search for and install Snap packages:

  • Search for a Package:

    snap find <search_keyword>
    
  • Install a Package:

    snap install <package_name>
    
  • Update Snap Packages: Snap packages update automatically, but you can manually check for updates with:

    snap refresh
    
  • Remove a Package:

    snap remove <package_name>
    

Conclusion

Snap provides a versatile and secure method of installing and maintaining software across different Linux distributions. By integrating snapd into RHEL and openSUSE, users can access a broader range of applications, often with versions more current than those available through native repositories. Whether you're a developer seeking the latest features or an administrator aiming for stability and security, Snap can be a valuable addition to your software management toolkit.