Installing snap on Red Hat Enterprise Linux (RHEL)


#1

Snap is available for Red Hat Enterprise Linux (RHEL) 7, from the 7.6 release onward, from the Extra Packages for Enterprise Linux (EPEL) repository.

It is not yet available in the EPEL 8 repository, and consequently, not yet available for RHEL 8 unless you build the RPM yourself.

ⓘ If you need to know which version of Red Hat you’re running, type cat /etc/redhat-release.

The EPEL repository can be added to your system with the following command:

$ sudo rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Adding the optional and extras repositories is also recommended:

$ sudo subscription-manager repos --enable "rhel-*-optional-rpms" --enable "rhel-*-extras-rpms"
$ sudo yum update

Snap can now be installed as follows:

$ sudo yum install snapd

Once installed, the systemd unit that manages the main snap communication socket needs to be enabled:

$ sudo systemctl enable --now snapd.socket

To enable classic snap support, enter the following to create a symbolic link between /var/lib/snapd/snap and /snap:

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

Either log out and back in again or restart your system to ensure snap’s paths are updated correctly.

Snap is now installed and ready to go! If you’re using a desktop, a great next step is to install the Snap Store app.


Installing snapd
Snap documentation
#2

Been trying to verify these steps myself. Some details about my setup:

  • Red Hat 8 with trial subscription
  • Machine is a HyperV Gen 2 VM

Steps and results:

  • sudo rpm ... succeeds

  • sudo subscription-manager repos ... fails with the following errors:

    Error: 'rhel-*-optional-rpms' does not match a valid repository ID...
    Error: 'rhel-*-extras-rpms' doesn not match a valid repository ID...
    
  • sudo yum install snapd fails with the following errors:

    Problem 1: cannot install the best update candidate for package annobin-8.64-1.el8.x86_64
     - nothing provides librpm.so.3()(64bit) needed by annobin-8.64-1.el8.x86_64
     - nothing provides librpmio.so.3()(64bit) needed by annobin-8.64-1.el8.x86_64
    Problem 2: cannot install the best update candidate for package libidn2-2.0.5-1.el8.x86_64
     - nothing provides libunistring.so.0()(64bit) needed by libidn2-2.0.5-1.el8.x86_64
    

    Running the command again with --nobest reports the same errors but appears to complete successfully.

  • sudo yum install snapd fails with the following errors:

    Problem: package snapd-2.39.2-1.el7.x86_64 requires snapd-selinux = 2.39.2-1.el7, but none of the providers can be installed
     - conflicting requests
     - nothing provides policycoreutils-python needed by snapd-selinux = 2.39.2-1.el7.noarch
    
    The `--nobest` option does not work.
    
    

At this point, I’m stuck… I’m also going to try installing directly onto bare metal, but we’ll see.


#3

Hi @craxal

Thanks for the feedback! It might be best to post this as a new topic in the snapd category to see if anybody can help you get the right instructions.

Not many people follow the docs category so really need to be lucky to get support here.


#4

(and @craxal) We’re actually looking into this now - it’s certainly an issue for the docs category if the instructions don’t work, so we’re trying to reproduce the problem and find a fix - I’ve just been through the same process with RHEL 8 and encountered the same problem.


#5

not many, but the right ones :smiley:


#6

I’ve commented on this issue here: