重庆思庄Oracle、KingBase、PostgreSQL、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 74|回复: 0

安装docker时解决container-selinux错误

[复制链接]
发表于 2026-4-25 11:45:21 | 显示全部楼层 |阅读模式
在安装docker前选择了阿里云的镜像仓库

yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo


在安装docker-ce、docker-ce-cli、containerd.io时出现了以下报错

Error: Package: containerd.io-1.6.33-3.1.el7.x86_64 (docker-ce-stable)
           Requires: container-selinux >= 2:2.74
Error: Package: docker-ce-rootless-extras-26.1.4-1.el7.x86_64 (docker-ce-stable)
           Requires: slirp4netns >= 0.4
Error: Package: 3:docker-ce-26.1.4-1.el7.x86_64 (docker-ce-stable)
           Requires: container-selinux >= 2:2.74
Error: Package: docker-ce-rootless-extras-26.1.4-1.el7.x86_64 (docker-ce-stable)
           Requires: fuse-overlayfs >= 0.7
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest


5466069b11e5f984f7.png

根据这个报错可以看出是container-selinux版本低或是没安装的原因,所以我们只需要安装一下contain-SElinux包就可以了,执行如下命令即可解决,没有安装wget 下载工具的,可以先执行yum -y install wget安装一个,然后再执行下面命令安装contain-SElinux包

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

7812269b11e970ce74.png

然后再次安装docker-ce、docker-ce-cli、containerd.io,就能正常安装了

2913269b11eb023fd7.png


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2026-5-11 13:18 , Processed in 0.482863 second(s), 24 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表