解决docker安装依赖关系报错,
先看错误信息:
[gh@vmdocker ~]$ sudo yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugi
已加载插件:fastestmirror, langpacks
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
Loading mirror speeds from cached hostfile
base | 3.6 kB 00:00:00
docker-ce-stable | 3.5 kB 00:00:00
epel | 4.3 kB 00:00:00
extras | 3.6 kB 00:00:00
updates | 3.6 kB 00:00:00
没有可用软件包 docker-buildx-plugi。
正在解决依赖关系
--> 正在检查事务
---> 软件包 containerd.io.x86_64.0.1.6.33-3.1.el7 将被 安装
--> 正在处理依赖关系 container-selinux >= 2:2.74,它被软件包 containerd.io-1.6.33-3.1.el7.x86_64 需要
---> 软件包 docker-ce.x86_64.3.26.1.4-1.el7 将被 安装
--> 正在处理依赖关系 container-selinux >= 2:2.74,它被软件包 3:docker-ce-26.1.4-1.el7.x86_64 需要
--> 正在处理依赖关系 docker-ce-rootless-extras,它被软件包 3:docker-ce-26.1.4-1.el7.x86_64 需要
---> 软件包 docker-ce-cli.x86_64.1.26.1.4-1.el7 将被 安装
--> 正在处理依赖关系 docker-buildx-plugin,它被软件包 1:docker-ce-cli-26.1.4-1.el7.x86_64 需要
--> 正在处理依赖关系 docker-compose-plugin,它被软件包 1:docker-ce-cli-26.1.4-1.el7.x86_64 需要
--> 正在检查事务
---> 软件包 containerd.io.x86_64.0.1.6.33-3.1.el7 将被 安装
--> 正在处理依赖关系 container-selinux >= 2:2.74,它被软件包 containerd.io-1.6.33-3.1.el7.x86_64 需要
---> 软件包 docker-buildx-plugin.x86_64.0.0.14.1-1.el7 将被 安装
---> 软件包 docker-ce.x86_64.3.26.1.4-1.el7 将被 安装
--> 正在处理依赖关系 container-selinux >= 2:2.74,它被软件包 3:docker-ce-26.1.4-1.el7.x86_64 需要
---> 软件包 docker-ce-rootless-extras.x86_64.0.26.1.4-1.el7 将被 安装
--> 正在处理依赖关系 fuse-overlayfs >= 0.7,它被软件包 docker-ce-rootless-extras-26.1.4-1.el7.x86_64 需要
--> 正在处理依赖关系 slirp4netns >= 0.4,它被软件包 docker-ce-rootless-extras-26.1.4-1.el7.x86_64 需要
---> 软件包 docker-compose-plugin.x86_64.0.2.27.1-1.el7 将被 安装
--> 解决依赖关系完成
错误:软件包:3:docker-ce-26.1.4-1.el7.x86_64 (docker-ce-stable)
需要:container-selinux >= 2:2.74
错误:软件包:docker-ce-rootless-extras-26.1.4-1.el7.x86_64 (docker-ce-stable)
需要:slirp4netns >= 0.4
错误:软件包:docker-ce-rootless-extras-26.1.4-1.el7.x86_64 (docker-ce-stable)
需要:fuse-overlayfs >= 0.7
错误:软件包:containerd.io-1.6.33-3.1.el7.x86_64 (docker-ce-stable)
需要:container-selinux >= 2:2.74
您可以尝试添加 --skip-broken 选项来解决该问题
** 发现 9 个已存在的 RPM 数据库问题, 'yum check' 输出如下:
icedtea-web-1.7.1-1.el7.x86_64 有缺少的需求 java-1.8.0-openjdk
icedtea-web-1.7.1-1.el7.x86_64 有缺少的需求 jpackage-utils
icedtea-web-1.7.1-1.el7.x86_64 有缺少的需求 jpackage-utils
jline-1.0-8.el7.noarch 有缺少的需求 java >= ('0', '1.5', None)
jline-1.0-8.el7.noarch 有缺少的需求 jpackage-utils
rhino-1.7R5-1.el7.noarch 有缺少的需求 jpackage-utils
rhino-1.7R5-1.el7.noarch 有缺少的需求 jpackage-utils
tagsoup-1.2.1-8.el7.noarch 有缺少的需求 jpackage-utils
tagsoup-1.2.1-8.el7.noarch 有缺少的需求 jpackage-utils >= ('0', '1.6', None)
[gh@vmdocker ~]$ sudo yum install -y container-selinux slirp4netns fuse-overlayfs container-selinux
已加载插件:fastestmirror, langpacks
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
Loading mirror speeds from cached hostfile
没有可用软件包 container-selinux。
没有可用软件包 slirp4netns。
没有可用软件包 fuse-overlayfs。
没有可用软件包 container-selinux。
错误:无须任何处理
[gh@vmdocker ~]$ sudo yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
已加载插件:fastestmirror, langpacks
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
Loading mirror speeds from cached hostfile
正在解决依赖关系
--> 正在检查事务
---> 软件包 containerd.io.x86_64.0.1.6.33-3.1.el7 将被 安装
--> 正在处理依赖关系 container-selinux >= 2:2.74,它被软件包 containerd.io-1.6.33-3.1.el7.x86_64 需要
---> 软件包 docker-buildx-plugin.x86_64.0.0.14.1-1.el7 将被 安装
---> 软件包 docker-ce.x86_64.3.26.1.4-1.el7 将被 安装
--> 正在处理依赖关系 container-selinux >= 2:2.74,它被软件包 3:docker-ce-26.1.4-1.el7.x86_64 需要
--> 正在处理依赖关系 docker-ce-rootless-extras,它被软件包 3:docker-ce-26.1.4-1.el7.x86_64 需要
---> 软件包 docker-ce-cli.x86_64.1.26.1.4-1.el7 将被 安装
---> 软件包 docker-compose-plugin.x86_64.0.2.27.1-1.el7 将被 安装
--> 正在检查事务
---> 软件包 containerd.io.x86_64.0.1.6.33-3.1.el7 将被 安装
--> 正在处理依赖关系 container-selinux >= 2:2.74,它被软件包 containerd.io-1.6.33-3.1.el7.x86_64 需要
---> 软件包 docker-ce.x86_64.3.26.1.4-1.el7 将被 安装
--> 正在处理依赖关系 container-selinux >= 2:2.74,它被软件包 3:docker-ce-26.1.4-1.el7.x86_64 需要
---> 软件包 docker-ce-rootless-extras.x86_64.0.26.1.4-1.el7 将被 安装
--> 正在处理依赖关系 fuse-overlayfs >= 0.7,它被软件包 docker-ce-rootless-extras-26.1.4-1.el7.x86_64 需要
--> 正在处理依赖关系 slirp4netns >= 0.4,它被软件包 docker-ce-rootless-extras-26.1.4-1.el7.x86_64 需要
--> 解决依赖关系完成
错误:软件包:3:docker-ce-26.1.4-1.el7.x86_64 (docker-ce-stable)
需要:container-selinux >= 2:2.74
错误:软件包:docker-ce-rootless-extras-26.1.4-1.el7.x86_64 (docker-ce-stable)
需要:slirp4netns >= 0.4
错误:软件包:docker-ce-rootless-extras-26.1.4-1.el7.x86_64 (docker-ce-stable)
需要:fuse-overlayfs >= 0.7
错误:软件包:containerd.io-1.6.33-3.1.el7.x86_64 (docker-ce-stable)
需要:container-selinux >= 2:2.74
您可以尝试添加 --skip-broken 选项来解决该问题
** 发现 9 个已存在的 RPM 数据库问题, 'yum check' 输出如下:
icedtea-web-1.7.1-1.el7.x86_64 有缺少的需求 java-1.8.0-openjdk
icedtea-web-1.7.1-1.el7.x86_64 有缺少的需求 jpackage-utils
icedtea-web-1.7.1-1.el7.x86_64 有缺少的需求 jpackage-utils
jline-1.0-8.el7.noarch 有缺少的需求 java >= ('0', '1.5', None)
jline-1.0-8.el7.noarch 有缺少的需求 jpackage-utils
rhino-1.7R5-1.el7.noarch 有缺少的需求 jpackage-utils
rhino-1.7R5-1.el7.noarch 有缺少的需求 jpackage-utils
tagsoup-1.2.1-8.el7.noarch 有缺少的需求 jpackage-utils
tagsoup-1.2.1-8.el7.noarch 有缺少的需求 jpackage-utils >= ('0', '1.6', None)
解决方法:修改镜像库,然后更新依赖
sudo vim /etc/yum.repos.d/CentOS-Base.repo 修改:baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
yum clean all
yum makecache
yum update
然后再安装docker:
sudo yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
欢迎评论,一起学习,对大家有用请点个赞。

浙公网安备 33010602011771号