解決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號