我在 Ubuntu 20.04 中安装 docker 时遇到问题。
wolf@linux:~$ sudo apt install docker.io
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
docker.io : Depends: containerd (>= 1.2.6-0ubuntu1~)
E: Unable to correct problems, you have held broken packages.
wolf@linux:~$
错误信息说我需要containerd (>= 1.2.6-0ubuntu1~)
这很奇怪,因为我已经有了更新的版本1.2.13-2
wolf@linux:~$ dpkg -l containerd.io
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-======================================
ii containerd.io 1.2.13-2 amd64 An open and reliable container runtime
wolf@linux:~$
系统已更新。我已经执行sudo apt update && sudo apt upgrade
并且不需要新的更新。
根据评论中的要求更新
wolf@linux:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal
wolf@linux:~$
containerd
并且containerd.io
是2个不同的包。尝试一下
dpkg -l containerd*
,您应该会看到这两个包。如果
containerd
不存在,请继续使用sudo apt install containerd
.让我知道这是否有帮助。
我有同样的错误,但情况更复杂:
显然,我在更新时忽略了一个明确的警告:
我没有深入挖掘,但是有一些关于安全性的更新包,它们不适合。但它没有解释为什么
docker.io
不接受安装containerd
的版本1.3.3-0ubuntu2.3
,实际上是>= 1.2.6-0ubuntu1~
解决方法
我可以通过降级
containerd
到主池包然后重新安装来解决这个问题docker.io
:错误报告
此处的错误报告:https ://bugs.launchpad.net/ubuntu/+source/docker.io/+bug/1940920