如何安装最新的 docker 版本而不出现依赖问题

如何安装最新的 docker 版本而不出现依赖问题

为了在 rhel 7.5 版本上安装 docker,我们准备以下内容

(从列表中https://download.docker.com/linux/centos/7/x86_64/stable/Packages/),并且只有最新的

curl https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-19.03.8-3.el7.x86_64.rpm -o docker.rpm
curl http://mirror.centos.org/centos/7.3.1611/extras/x86_64/Packages/docker-ce-selinux-17.03.3.ce-1.el7.noarch.rpm -o containerselinux.rpm
curl http://mirror.centos.org/centos/7.3.1611/extras/x86_64/Packages/docker-ce-cli-19.03.8-3.el7.x86_64.rpm     -o docker-ce-cli.rpm
curl http://mirror.centos.org/centos/7.3.1611/extras/x86_64/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm        -o containerd.io.rpm

文件是:

-rw-r--r--  1 root      root       25697324 May  8 13:17 docker.rpm
-rw-r--r--  1 root      root           7793 May  8 13:18 containerselinux.rpm
-rw-r--r--  1 root      root           7793 May  8 13:21 docker-ce-cli.rpm
-rw-r--r--  1 root      root           7793 May  8 13:24 containerd.io.rpm

不是我们想要安装所有它们

 yum localinstall -y  docker-ce-cli.rpm containerselinux.rpm docker.rpm  containerd.io.rpm
    Loaded plugins: langpacks
configuration
    Cannot open: docker-ce-cli.rpm. Skipping.
    Cannot open: containerselinux.rpm. Skipping.
    Examining docker.rpm: 3:docker-ce-19.03.8-3.el7.x86_64
    Marking docker.rpm to be installed
    Cannot open: containerd.io.rpm. Skipping.
    Resolving Dependencies
    --> Running transaction check
    ---> Package docker-ce.x86_64 3:19.03.8-3.el7 will be installed
    --> Processing Dependency: container-selinux >= 2:2.74 for package: 3:docker-ce-19.03.8-3.el7.x86_64
    --> Processing Dependency: containerd.io >= 1.2.2-3 for package: 3:docker-ce-19.03.8-3.el7.x86_64
    --> Processing Dependency: docker-ce-cli for package: 3:docker-ce-19.03.8-3.el7.x86_64
    --> Finished Dependency Resolution
    Error: Package: 3:docker-ce-19.03.8-3.el7.x86_64 (/docker)
               Requires: container-selinux >= 2:2.74
    Error: Package: 3:docker-ce-19.03.8-3.el7.x86_64 (/docker)
               Requires: docker-ce-cli
    Error: Package: 3:docker-ce-19.03.8-3.el7.x86_64 (/docker)
               Requires: containerd.io >= 1.2.2-3
     You could try using --skip-broken to work around the problem

We  not understand why we get 

    Requires: docker-ce-cli
    Requires: containerd.io >= 1.2.2-3
    Requires: container-selinux >= 2:2.74

由于我们安装了最新版本

第二

我们也得到

Cannot open: docker-ce-cli.rpm. Skipping.
Cannot open: containerselinux.rpm. Skipping.

但我的卷发怎么了?

在我修复并设置正确的 URL 后,我们仍然得到:

yum localinstall  docker.rpm  containerselinux.rpm docker-ce-cli.rpm containerd.io.rpm -y
Loaded plugins: langpacks
Examining docker.rpm: 3:docker-ce-19.03.8-3.el7.x86_64
Marking docker.rpm to be installed
Examining containerselinux.rpm: docker-ce-selinux-17.03.3.ce-1.el7.noarch
Marking containerselinux.rpm to be installed
Examining docker-ce-cli.rpm: 1:docker-ce-cli-19.03.8-3.el7.x86_64
Marking docker-ce-cli.rpm to be installed
Examining containerd.io.rpm: containerd.io-1.2.6-3.3.el7.x86_64
Marking containerd.io.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package containerd.io.x86_64 0:1.2.6-3.3.el7 will be installed
--> Processing Dependency: container-selinux >= 2:2.74 for package: containerd.io-1.2.6-3.3.el7.x86_64
                                                                                                                                                                                                                                                                                                                  | 4.3 kB  00:00:00
---> Package docker-ce.x86_64 3:19.03.8-3.el7 will be installed
--> Processing Dependency: container-selinux >= 2:2.74 for package: 3:docker-ce-19.03.8-3.el7.x86_64
---> Package docker-ce-cli.x86_64 1:19.03.8-3.el7 will be installed
---> Package docker-ce-selinux.noarch 0:17.03.3.ce-1.el7 will be installed
Removing docker-ce-selinux.noarch 0:17.03.3.ce-1.el7 - u due to obsoletes from docker-ce.x86_64 3:19.03.8-3.el7 - u
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package containerd.io.x86_64 0:1.2.6-3.3.el7 will be installed
--> Processing Dependency: container-selinux >= 2:2.74 for package: containerd.io-1.2.6-3.3.el7.x86_64
---> Package docker-ce.x86_64 3:19.03.8-3.el7 will be installed
--> Processing Dependency: container-selinux >= 2:2.74 for package: 3:docker-ce-19.03.8-3.el7.x86_64
---> Package docker-ce-selinux.noarch 0:17.03.3.ce-1.el7 will be installed
--> Finished Dependency Resolution
Error: Package: containerd.io-1.2.6-3.3.el7.x86_64 (/containerd.io)
           Requires: container-selinux >= 2:2.74
Error: Package: 3:docker-ce-19.03.8-3.el7.x86_64 (/docker)
           Requires: container-selinux >= 2:2.74
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

答案1

containerselinux.rpmdocker-ce-cli.rpm、 和docker-ce-cli.rpm实际上并不是 RPM,而是带有 404 错误的 HTML,因为您使用了错误的 URL 来下载它们。删除它们并从正确的 URL 重新下载它们。

相关内容