redhatrhel8

Try to install snapd but giving `conflicting requests` error


I am trying to install snapd but giving this error.

Operating System - Red Hat Enterprise Linux release 8.6 (Ootpa)

Error: 
 Problem: package snapd-2.57.6-2.el8.x86_64 requires snapd-selinux = 2.57.6-2.el8, but none of the providers can be installed
  - conflicting requests
  - nothing provides selinux-policy >= 3.14.3-108.el8 needed by snapd-selinux-2.57.6-2.el8.noarch
  - nothing provides selinux-policy-base >= 3.14.3-108.el8 needed by snapd-selinux-2.57.6-2.el8.noarch
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

Solution

  • I have the same problem. There's a long discussion about this here: https://forum.snapcraft.io/t/trouble-installing-snapd-on-rhel-8/13140/2. It looks like the only way to do it, if you can install all the necessary build tools, is to build from sources, as one of the posts there suggests.(I couldn't do it on my system because it's having subscription management issues.)

    I also tried using CR repository, as suggested in the instructions for CentOS here: https://snapcraft.io/docs/installing-snap-on-centos, but that didn't work for me, either (I guess it's really just for CentOS and not RHEL).

    UPDATE:

    I finally found a solution (where there's a will...)! I manually installed all the requirements, one by one, that weren't available in the epel-release repo. My process was the following:

    wget https://rpmfind.net/linux/centos/8-stream/BaseOS/x86_64/os/Packages/rpm-4.14.3-19.el8.x86_64.rpm
    wget https://rpmfind.net/linux/centos/8-stream/BaseOS/x86_64/os/Packages/rpm-libs-4.14.3-19.el8.x86_64.rpm
    wget https://dl.rockylinux.org/pub/rocky/8/BaseOS/aarch64/os/Packages/s/selinux-policy-3.14.3-108.el8.noarch.rpm
    
    sudo yum install http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/libsemanage-2.9-9.el8.x86_64.rpm --allowerasing -y
    sudo yum install http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/policycoreutils-2.9-19.el8.x86_64.rpm -y
    
    sudo rpm -i --force rpm-4.14.3-19.el8.x86_64.rpm
    sudo rpm -i --force rpm-libs-4.14.3-19.el8.x86_64.rpm
    sudo rpm -i --force selinux-policy-3.14.3-108.el8.noarch.rpm
    
    sudo yum install http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/python3-libsemanage-2.9-9.el8.x86_64.rpm -y
    sudo yum install http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/python3-policycoreutils-2.9-19.el8.noarch.rpm -y
    sudo yum install http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/policycoreutils-python-utils-2.9-19.el8.noarch.rpm -y
    sudo yum install http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/selinux-policy-minimum-3.14.3-108.el8.noarch.rpm -y
    sudo yum install http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/libseccomp-2.5.2-1.el8.x86_64.rpm -y
    
    sudo yum install https://download-ib01.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/s/snapd-selinux-2.57.6-2.el8.noarch.rpm -y
    
    sudo yum install snapd -y
    sudo yum update snapd  -y
    
    

    It's conceivable that on your system something else will be missing. If you run into an error telling you that nothing provides package XYZ, you can find it here: https://centos.pkgs.org/8-stream/centos-baseos-x86_64/ and simply sudo yum install directly from the binary package URL; e.g.: an example binary package link

    That's exactly what my process was, and here's what I have now:

    $ cat /etc/redhat-release                                                                                                                                                                                                                                                                                                                                                                                          (base)
    Red Hat Enterprise Linux release 8.2 (Ootpa)
    $ snap --version                                                                                                                                                                                                                                                                                                                                                                                                   (base)
    snap    2.57.6-2.el8
    snapd   2.52.1
    series  16
    rhel    8.2
    kernel  4.18.0-193.6.3.el8_2.x86_64