我正在尝试安装 snapd 但出现此错误。
操作系统 -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)
Run Code Online (Sandbox Code Playgroud)
我也有同样的问题。这里有一个关于此问题的长时间讨论:https://forum.snapcraft.io/t/trouble-installing-snapd-on-rhel-8/13140/2。如果您可以安装所有必要的构建工具,那么看起来唯一的方法就是从源代码构建,正如其中一篇文章所建议的那样。(我无法在我的系统上执行此操作,因为它存在订阅管理问题.)
我还尝试使用 CR 存储库,正如 CentOS 的说明中所建议的:https: //snapcraft.io/docs/installing-snap-on-centos,但这对我来说也不起作用(我想这真的只是适用于 CentOS 而不是 RHEL)。
更新:
我终于找到了一个解决方案(有意愿......)!我手动安装了存储库中没有的所有要求,一一安装epel-release。我的过程如下:
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
Run Code Online (Sandbox Code Playgroud)
可以想象,您的系统上可能会缺少其他东西。如果您遇到错误,告诉您没有任何内容提供包 XYZ,您可以在这里找到它: https: //centos.pkgs.org/8-stream/centos-baseos-x86_64/并sudo yum install直接从二进制包 URL 找到它;例如:

这正是我的过程,这就是我现在所拥有的:
$ 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
Run Code Online (Sandbox Code Playgroud)