解决错误:软件包:docker-ce-18.06.1.ce-3.el7.x86_64(docker-ce-stable)要求:container-selinux> = 2.9
时间:2020-02-23 14:31:01 来源:igfitidea点击:
在Centos 7上安装Docker-ce时遇到过这样的错误吗?
Error: Package: docker-ce-18.06.1.ce-3.el7.x86_64 (docker-ce-stable) Requires: container-selinux >= 2.9
好吧,最简单的解决方法是安装" container-selinux"软件包。为此,请转到官方的Centos镜像http://mirror.centos.org/centos/7/extras/x86_64/Packages/,并找到最新的软件包。在撰写本文时,它是container-selinux-2.42-1.gitad8f0f7.el7.noarch.rpm
。拥有它后,复制其链接地址(url),转到我们要其中安装docker的服务器的终端并运行:
$sudo yum -y install http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.42-1.gitad8f0f7.el7.noarch.rpm Loaded plugins: fastestmirror container-selinux-2.42-1.gitad8f0f7.el7.noarch.rpm | 32 kB 00:00:00 Examining /var/tmp/yum-root-EnC13P/container-selinux-2.42-1.gitad8f0f7.el7.noarch.rpm: 2:container-selinux-2.42-1.gitad8f0f7.el7.noarch Marking /var/tmp/yum-root-EnC13P/container-selinux-2.42-1.gitad8f0f7.el7.noarch.rpm to be installed Resolving Dependencies --> Running transaction check ---> Package container-selinux.noarch 2:2.42-1.gitad8f0f7.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================================================= Package Arch Version Repository Size ================================================================================================================= Installing: container-selinux noarch 2:2.42-1.gitad8f0f7.el7 /container-selinux-2.42-1.gitad8f0f7.el7.noarch 34 k
之后,继续安装docker-ce
$sudo yum -y install docker-ce Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Resolving Dependencies --> Running transaction check ---> Package docker-ce.x86_64 0:18.06.1.ce-3.el7 will be installed --> Processing Dependency: libltdl.so.7()(64bit) for package: docker-ce-18.06.1.ce-3.el7.x86_64 --> Running transaction check ---> Package libtool-ltdl.x86_64 0:2.4.2-22.el7_3 will be installed --> Finished Dependency Resolution
Dependencies Resolved ================================================================================================================= Package Arch Version Repository Size ================================================================================================================= Installing: docker-ce x86_64 18.06.1.ce-3.el7 docker-ce-stable 41 M