我在 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:~$