我在 RHEL-7 中安装
Requires: fuse-overlayfs >= 0.7
时遇到 docker
错误。
sudo yum install docker-ce
Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
* epel: mirrors.syringanetworks.net
Resolving Dependencies
--> Running transaction check
---> Package docker-ce.x86_64 3:20.10.2-3.el7 will be installed
--> Processing Dependency: containerd.io >= 1.4.1 for package: 3:docker-ce-20.10.2-3.el7.x86_64
--> Processing Dependency: docker-ce-cli for package: 3:docker-ce-20.10.2-3.el7.x86_64
--> Processing Dependency: docker-ce-rootless-extras for package: 3:docker-ce-20.10.2-3.el7.x86_64
--> Running transaction check
---> Package containerd.io.x86_64 0:1.4.3-3.1.el7 will be installed
---> Package docker-ce-cli.x86_64 1:20.10.2-3.el7 will be installed
---> Package docker-ce-rootless-extras.x86_64 0:20.10.2-3.el7 will be installed
--> Processing Dependency: fuse-overlayfs >= 0.7 for package: docker-ce-rootless-extras-20.10.2-3.el7.x86_64
--> Finished Dependency Resolution
Error: Package: docker-ce-rootless-extras-20.10.2-3.el7.x86_64 (docker-ce-stable)
Requires: fuse-overlayfs >= 0.7
You could try using --skip-broken to work around
我已经尝试过了
sudo rpm -Uvh http://mirror.centos.org/centos/7/extras/x86_64/Packages/fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm
Retrieving http://mirror.centos.org/centos/7/extras/x86_64/Packages/fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm
warning: /var/tmp/rpm-tmp.TZLjHD: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
error: Failed dependencies:
libfuse3.so.3()(64bit) is needed by fuse-overlayfs-0.7.2-6.el7_8.x86_64
libfuse3.so.3(FUSE_3.0)(64bit) is needed by fuse-overlayfs-0.7.2-6.el7_8.x86_64
libfuse3.so.3(FUSE_3.2)(64bit) is needed by fuse-overlayfs-0.7.2-6.el7_8.x86_64
在@user3495504的答案之上,我们解决问题的方法是在文件顶部添加一个条目
/etc/yum.repos.d/docker-ce.repo
,内容如下:
[centos-extras]
name=Centos extras - $basearch
baseurl=http://mirror.centos.org/centos/7/extras/x86_64
enabled=1
gpgcheck=1
gpgkey=http://centos.org/keys/RPM-GPG-KEY-CentOS-7
然后安装命令:
yum -y install slirp4netns fuse-overlayfs container-selinux
成功了。
[编辑]
尝试安装 Docker 时也遇到了这个问题。 这有助于获得保险丝覆盖fs
sudo yum install fuse3-devel
wget http://mirror.centos.org/centos/7/extras/x86_64/Packages/fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm
sudo yum localinstall fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm
我从 http://mirror.centos.org/centos/7/extras/x86_64/Packages/
获取了包 url我接下来缺少的是
slirp4netns >= 0.4
。 我将尝试同样的技巧。 是的,这确实有效,并且 docker 安装完成了
sudo yum install docker-ce docker-ce-cli containerd.io
我在 Oracle Linux 7.9 中安装 docker 版本 20 时遇到了这个问题。相反,安装版本 19,依赖关系没有问题,并且不需要从 CentOS Extras 存储库安装软件包。
sudo yum install docker-ce-19.03.9 docker-ce-cli-19.03.9 containerd.io docker-compose-plugin
编辑
显示所有可用版本
yum list docker-ce --showduplicates | sort -r
请注意,我必须将镜像更改为接受答案的baseurl地址中的vault 从 baseurl=http://mirror.centos.org/centos/7/extras/x86_64 到 baseurl=http://vault.centos.org/centos/7/extras/x86_64
安装fuse3 libs包。这将提供缺少的依赖项。然后在继续进行 docker 安装之前尝试使用保险丝覆盖包