CentOS8安装Docker时提示缺少不低于1.2.2-3的containerd.io的错误的解决

在CentOS8中安装Docker时,按照CentOS7的安装步骤,在安装Docker这一步时会出现缺少>=1.2.2-3的containerd.io的错误提示,这里的CentOS8具体的系统版本为CentOS Linux release 8.1.1911。至于CentOS7安装Docker可参考Docker在CentOS7上的安装及常用命令。

一、错误信息

在安装最新版docker-ce时出现以下错误提示:

错误:
 问题: package docker-ce-3:19.03.11-3.el7.x86_64 requires containerd.io >= 1.2.2-3, but none of the providers can be installed
 - cannot install the best candidate for the job
 - package containerd.io-1.2.10-3.2.el7.x86_64 is excluded
 - package containerd.io-1.2.13-3.1.el7.x86_64 is excluded
 - package containerd.io-1.2.13-3.2.el7.x86_64 is excluded
 - package containerd.io-1.2.2-3.3.el7.x86_64 is excluded
 - package containerd.io-1.2.2-3.el7.x86_64 is excluded
 - package containerd.io-1.2.4-3.1.el7.x86_64 is excluded
 - package containerd.io-1.2.5-3.1.el7.x86_64 is excluded
 - package containerd.io-1.2.6-3.3.el7.x86_64 is excluded
(尝试添加 '--skip-broken' 来跳过无法安装的软件包 或 '--nobest' 来不只使用最佳选择的软件包)

根据错误信息可以得知该版本docker-ce的包缺少不低于1.2.2-3版本的containerd.io。

二、解决方法

第一种方法就是降低Docker的版本。如果不想降低Docker版本,那么就需要安装不低于1.2.2-3版本的containerd.io。至于containerd.io的安装,可以进入Docker官方和阿里云镜像库选择合适版本:

  • https://download.docker.com/linux/centos/7/x86_64/edge/Packages/
  • https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/edge/Packages/

这里选择使用阿里云镜像库安装不低于1.2.2-3版本的containerd.io,命令如下:

yum install -y https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/edge/Packages/containerd.io-1.2.13-3.2.el7.x86_64.rpm

然后执行以下命令重新安装最新版Docker:

sudo yum install docker-ce

之后的过程按照CentOS7的步骤进行。查看下Docker版本:

[root@RtxTitanV ~]# docker version
Client: Docker Engine - Community
 Version:           19.03.11
 API version:       1.40
 Go version:        go1.13.10
 Git commit:        42e35e61f3
 Built:             Mon Jun  1 09:13:48 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.11
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.10
  Git commit:       42e35e61f3
  Built:            Mon Jun  1 09:12:26 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

发现已经安装成功,问题解决。

你可能感兴趣的:(Docker)