dnf - 无法安装最适合该工作的候选人

dnf - 无法安装最适合该工作的候选人

我刚刚安装了 CentOS8...

$ cat /etc/redhat-release 
CentOS Linux release 8.0.1905 (Core) 
$ 

...现在尝试跟随获取 Docker 引擎 - CentOS 社区 | Docker 文档,但遇到以下错误:

$ sudo dnf install -y yum-utils   device-mapper-persistent-data   lvm2
Last metadata expiration check: 0:01:25 ago on Thu 31 Oct 2019 03:00:18 PM EDT.
Package device-mapper-persistent-data-0.7.6-1.el8.x86_64 is already installed.
Package lvm2-8:2.03.02-6.el8.x86_64 is already installed.
Dependencies resolved.
=========================================================================================================
 Package                  Arch                  Version                      Repository             Size
=========================================================================================================
Installing:
 dnf-utils                noarch                4.0.2.2-3.el8                BaseOS                 62 k

Transaction Summary
=========================================================================================================
Install  1 Package

Total download size: 62 k
Installed size: 18 k
Downloading Packages:
dnf-utils-4.0.2.2-3.el8.noarch.rpm                                        59 kB/s |  62 kB     00:01    
---------------------------------------------------------------------------------------------------------
Total                                                                     28 kB/s |  62 kB     00:02     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                 1/1 
  Installing       : dnf-utils-4.0.2.2-3.el8.noarch                                                  1/1 
  Running scriptlet: dnf-utils-4.0.2.2-3.el8.noarch                                                  1/1 
  Verifying        : dnf-utils-4.0.2.2-3.el8.noarch                                                  1/1 

Installed:
  dnf-utils-4.0.2.2-3.el8.noarch                                                                         

Complete!
$ sudo yum-config-manager \
>     --add-repo \
>     https://download.docker.com/linux/centos/docker-ce.repo
Adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
$ sudo yum-config-manager --enable docker-ce-nightly
$ sudo yum-config-manager --disable docker-ce-nightly
$ sudo yum install docker-ce docker-ce-cli containerd.io
CentOS-8 - AppStream                                                     2.0 kB/s | 4.3 kB     00:02    
CentOS-8 - Base                                                          1.7 kB/s | 3.9 kB     00:02    
CentOS-8 - Extras                                                        736  B/s | 1.5 kB     00:02    
Docker CE Stable - x86_64                                                9.4 kB/s |  20 kB     00:02    
Error: 
 Problem: package docker-ce-3:19.03.4-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.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
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
$ 

请指教。

答案1

尝试:

dnf install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm

更多详细信息,您可以阅读这篇博文

答案2

这确实是一个非常奇怪的问题。禁用应用流存储库对我有帮助,但我仍然不太明白发生了什么:

dnf --disablerepo=AppStream install docker-ce

相关内容