Centos 安装 Docker 报错:Error: Problem 1: problem with installed package podman-2.2.1-7.module.xxx

环境:

  • Centos 8
  • K8S 1.23.5
  • Docker 20.10.7K8S 1.23.5 所匹配的版本)

虽然 k8s 1.24 版本将会把 Dockershim 移除,但是截止到 2022-04-16 为止,1.24 正式版还没有发布,所以就选用 1.23.5 正式版,同时对 Docker 比较熟悉,所以还是继续使用 Docker

疫情在家正在用闲置的机器搭建 k8s 集群,但是刚起步安装 Docker 时则直接报错。

yum install docker-ce-20.10.7 docker-ce-cli-20.10.7 containerd.io

报错信息如下:

Last metadata expiration check: 0:03:31 ago on Sat 16 Apr 2022 11:10:20 AM CEST.
Error: 
 Problem 1: problem with installed package podman-2.2.1-7.module_el8.3.0+699+d61d9c41.x86_64
  - package podman-2.2.1-7.module_el8.3.0+699+d61d9c41.x86_64 requires runc >= 1.0.0-57, but none of the providers can be installed
  - package containerd.io-1.4.4-3.1.el8.x86_64 conflicts with runc provided by runc-1.0.0-70.rc92.module_el8.3.0+699+d61d9c41.x86_64
  - package containerd.io-1.4.4-3.1.el8.x86_64 obsoletes runc provided by runc-1.0.0-70.rc92.module_el8.3.0+699+d61d9c41.x86_64
  - cannot install the best candidate for the job
  - package runc-1.0.0-64.rc10.module_el8.3.0+479+69e2ae26.x86_64 is filtered out by modular filtering
 Problem 2: problem with installed package buildah-1.16.7-4.module_el8.3.0+699+d61d9c41.x86_64
  - package buildah-1.16.7-4.module_el8.3.0+699+d61d9c41.x86_64 requires runc >= 1.0.0-26, but none of the providers can be installed
  - package docker-ce-3:20.10.6-3.el8.x86_64 requires containerd.io >= 1.4.1, but none of the providers can be installed
  - package containerd.io-1.4.3-3.1.el8.x86_64 conflicts with runc provided by runc-1.0.0-70.rc92.module_el8.3.0+699+d61d9c41.x86_64
  - package containerd.io-1.4.3-3.1.el8.x86_64 obsoletes runc provided by runc-1.0.0-70.rc92.module_el8.3.0+699+d61d9c41.x86_64
  - package containerd.io-1.4.3-3.2.el8.x86_64 conflicts with runc provided by runc-1.0.0-70.rc92.module_el8.3.0+699+d61d9c41.x86_64
  - package containerd.io-1.4.3-3.2.el8.x86_64 obsoletes runc provided by runc-1.0.0-70.rc92.module_el8.3.0+699+d61d9c41.x86_64
  - package containerd.io-1.4.4-3.1.el8.x86_64 conflicts with runc provided by runc-1.0.0-70.rc92.module_el8.3.0+699+d61d9c41.x86_64
  - package containerd.io-1.4.4-3.1.el8.x86_64 obsoletes runc provided by runc-1.0.0-70.rc92.module_el8.3.0+699+d61d9c41.x86_64
  - conflicting requests
  - package runc-1.0.0-56.rc5.dev.git2abd837.module_el8.3.0+569+1bada2e4.x86_64 is filtered out by modular filtering
  - package runc-1.0.0-64.rc10.module_el8.3.0+479+69e2ae26.x86_64 is filtered out by modular filtering
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

这就很尴尬了,看报错信息是已经有了 podmanbuildah , 看样子操作系统只允许一个容器工具存在。

如果系统有了 Docker,再去安装 Podman 也会有意义的错误信息。

既然不兼容,那就卸载掉 podman ,然后在安装 Docker

卸载 podman

yum -y erase podman buildah

执行安装 Docker 命令:

yum install docker-ce-20.10.7 docker-ce-cli-20.10.7 containerd.io

大功告成,接下来还需验证一下:

docker -v

能正常输出则表示安装成功,继续开启 K8S 之旅。

发表回复

您的电子邮箱地址不会被公开。