Can't install snap on RHEL 7.6 or 8.1

I have tried both OS using Azure VM

Is always a similar error related to selinux. I have no experience with RHEL but the client is asking for it and I can’t install the tools I need without snap. Any ide how to force this install or download an rpm and install it directly?

Error: Package: snapd-selinux-2.54.1-1.el7.noarch (epel) Requires: selinux-policy-base >= 3.13.1-268.el7_9.2 Installed: selinux-policy-targeted-3.13.1-229.el7_6.15.noarch (@rhui-rhel-7-server-rhui-eus-rpms) selinux-policy-base = 3.13.1-229.el7_6.15

Thanks in advance

This error message fully describes the problem. The package in EPEL in epel requires the latest version of selinux-policy-base from RHEL7 which is 3.13.1-268.el7_9.2, while yours is selinux-policy-base = 3.13.1-229.el7_6.15. AFAICT RHEL 7.6 and 8.1 are already past their maintenance windows. EPEL packages are built only against the latest versions of RHEL releases, so you’d actually need to update to 7.9 or 8.4 (or 8.5?). I don’t know whether Azure provides those, best to get in touch with their support.

Alternatively you can grab srpms and just rebuild the packages yourself which is probably the easiest solution if you cannot update.

Thanks for your answer, I tried now with RHEL 7.9 and I can see those packages being installed but when I try sudo yum install snapd I get

Loaded plugins: product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

No package snapd available.

Error: Nothing to do

Is there something else I can try?

You need to add EPEL repositories first, see https://docs.fedoraproject.org/en-US/epel/.

Sorry I meant I followed the steps from https://snapcraft.io/docs/installing-snap-on-red-hat

$ sudo rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
$ sudo subscription-manager repos --enable "rhel-*-optional-rpms" --enable "rhel-*-extras-rpms"
$ sudo yum update
$ sudo yum install snapd

And then I got Loaded plugins: product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

No package snapd available.

Error: Nothing to do

My RHEL dev license has expired so I’m checking on CentOS 7:

google:centos-7-64 .../mini/hello# yum list snapd*
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: atl.mirrors.clouvider.net
 * epel: dl.fedoraproject.org
 * extras: mirror.atl.genesisadaptive.com
 * updates: mirror.math.princeton.edu
Available Packages
snapd.x86_64                  2.54.2-1.el7             epel
snapd-devel.noarch            2.54.2-1.el7             epel
snapd-glib.x86_64             1.58-1.el7               epel
snapd-glib-devel.x86_64       1.58-1.el7               epel
snapd-glib-tests.x86_64       1.58-1.el7               epel
snapd-qt.x86_64               1.58-1.el7               epel
snapd-qt-devel.x86_64         1.58-1.el7               epel
snapd-qt-qml.x86_64           1.58-1.el7               epel
snapd-qt-tests.x86_64         1.58-1.el7               epel
snapd-selinux.noarch          2.54.2-1.el7             epel

The repositories I have:

google:centos-7-64 .../mini/hello# yum repolist
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: atl.mirrors.clouvider.net
 * epel: dl.fedoraproject.org
 * extras: mirror.atl.genesisadaptive.com
 * updates: mirror.math.princeton.edu
repo id                        repo name                                            status
base/7/x86_64                  CentOS-7 - Base                                      10072
epel/x86_64                    Extra Packages for Enterprise Linux 7 - x86_64       13720
extras/7/x86_64                CentOS-7 - Extras                                      500
google-cloud-sdk               Google Cloud SDK                                      2099
google-compute-engine          Google Compute Engine                                   10
updates/7/x86_64               CentOS-7 - Updates                                    3355

I dont have a RHEL subscription, I’m just using whatever Azure includes in the distro. Do you think that’s the problem?

Could be, I’m not up to date on how the subscription works for RHEL these days.

If you’re trying to enable the additional RH repos listed (outside of EPEL), you are likely encountering a problem there. Once you’ve got a valid subscription, I’d recommend upgrading to the most recent releases, if possible (e.g. 7.9 and 8.5, respectively). I am running several snaps on my RHEL 8.5 install at present, without issue.

1 Like