21

I'm having a problem to install docker in Ubuntu 20.04.

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

Error message says that I need containerd (>= 1.2.6-0ubuntu1~)

It's strange as I already have even newer version which is 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:~$ 

The system is updated. I already performed sudo apt update && sudo apt upgrade and no new update required.

Update as requested in comment

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:~$ 
0

2 Answers 2

30

containerd and containerd.io are 2 different packages.

Try dpkg -l containerd* and you should see both packages.

$ dpkg -l containerd*
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     1.3.3-0ubuntu2 amd64        daemon to control runC
rc  containerd.io  1.2.13-2       amd64        An open and reliable container runtime
$ 

If containerd not there, go ahead and install it with sudo apt install containerd.

Let me know if this helps.

3
  • 1
    Thanks you!. it is help me
    – Amit Bera
    Sep 18, 2020 at 12:36
  • 2021-03-20 Ubuntu software update borked my docker! all gone! I tried to reinstall but got the same error message as above, even though I have containerd, containerd.io Mar 20, 2021 at 8:22
  • @IvanixDevon check out the other answer ;) Jun 15, 2021 at 1:11
3

I had the same error but a more complex situation:

~# dpkg -l | grep containerd
ii  containerd                            1.3.3-0ubuntu2.3                  amd64        daemon to control runC

~# apt-get 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~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

obviously, I overlooked a clear warning while updating:

~# apt-get dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  bridge-utils cgroupfs-mount dns-root-data dnsmasq-base git git-man iptables libcurl3-gnutls liberror-perl libip6tc2 libnetfilter-conntrack3 libnfnetlink0 libnftnl11 libnghttp2-14 librtmp1 libssh-4 patch pigz ubuntu-fan
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  docker.io                    ^^^^^^^  !!!
The following packages will be upgraded:
  containerd
1 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Need to get 27.8 MB of archives.
After this operation, 192 MB disk space will be freed.
Do you want to continue? [Y/n] 

I didn't dig deeper, but there are newer packages on security, which don't fit together. But it doesn't explain why docker.io doesn't accept the installed containerd of version 1.3.3-0ubuntu2.3 which is in fact >= 1.2.6-0ubuntu1~

~# apt-cache policy docker.io containerd
docker.io:
  Installed: (none)
  Candidate: 19.03.8-0ubuntu1.20.04.1
  Version table:
     19.03.8-0ubuntu1.20.04.1 500
        500 http://ch.archive.ubuntu.com/ubuntu focal-security/universe amd64 Packages
        100 /var/lib/dpkg/status
     19.03.8-0ubuntu1 500
        500 http://ch.archive.ubuntu.com/ubuntu focal/universe amd64 Packages

containerd:
  Installed: 1.3.3-0ubuntu2.3
  Candidate: 1.3.3-0ubuntu2.3
  Version table:
 *** 1.3.3-0ubuntu2.3 500
        500 http://ch.archive.ubuntu.com/ubuntu focal-security/main amd64 Packages
        100 /var/lib/dpkg/status
     1.3.3-0ubuntu2 500
        500 http://ch.archive.ubuntu.com/ubuntu focal/main amd64 Packages

Workaround

I could fix this problem by downgrading containerd to the main pool package and then reinstalling docker.io:

~# apt-get install containerd=1.3.3-0ubuntu2
The following packages will be DOWNGRADED:
  containerd
~# apt-get install docker.io

Bug report

Bug report here: https://bugs.launchpad.net/ubuntu/+source/docker.io/+bug/1940920

You must log in to answer this question.