在RHEL 8.6安装snapd时遇“conflicting requests”错误求助
在RHEL 8.6安装snapd时的依赖错误解决方法
问题详情
操作系统:Red Hat Enterprise Linux release 8.6 (Ootpa)
执行sudo dnf install snapd时触发以下错误:
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)
解决步骤
1. 优先更新系统补丁
RHEL 8.6默认源中的selinux-policy版本可能低于snapd要求的3.14.3-108.el8。先更新系统到最新状态:
sudo dnf update -y
更新完成后重新尝试安装:
sudo dnf install snapd -y
2. 启用CodeReady Linux Builder仓库
如果更新后仍缺少依赖,需要启用RHEL官方的额外仓库,该仓库包含更多软件包:
sudo subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms
启用后再次执行系统更新和snapd安装命令。
3. 安装兼容版本的snapd
若上述方法无效,可安装与当前系统selinux-policy版本匹配的旧版snapd:
- 先查看当前系统的
selinux-policy版本:rpm -q selinux-policy - 找到对应兼容的
snapd和snapd-selinux版本(例如2.54.3-1.el8,需匹配你的selinux-policy版本),执行安装:sudo dnf install snapd-2.54.3-1.el8 snapd-selinux-2.54.3-1.el8 -y
4. 临时绕过依赖检查(不推荐)
如果只是临时使用,可通过参数跳过严格依赖检查,但这可能导致系统兼容性或安全问题:
sudo dnf install snapd --nobest -y
或:
sudo dnf install snapd --setopt=strict=0
内容的提问来源于stack exchange,提问作者KARNAV PARGI
相关产品推荐
相关产品推荐

