I am trying to install Docker on my Ubuntu 18.04, but I am getting this error:

The following packages have unmet dependencies:
  docker-ce : Depends: containerd.io (>= 1.2.2-3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

What do I do to fix it?

  • Should be same issue as forums.docker.com/t/… Same problem exists on 16.04 too Commented Oct 11, 2019 at 12:26
  • i have checked it, but my problem has been not solved !
    – vatsalay
    Commented Oct 23, 2019 at 14:46

7 Answers 7


You have to install containerd package, this is how I solved it.

$ curl -O https://download.docker.com/linux/ubuntu/dists/bionic/pool/edge/amd64/containerd.io_1.2.2-3_amd64.deb

$ sudo apt install ./containerd.io_1.2.2-3_amd64.deb 
  • i actually upgraded from ubuntu 18.04 to ubuntu 19.04, and this problem has been solved automatically btw Thanks
    – vatsalay
    Commented Jan 17, 2020 at 16:50
  • 1
    Thanks! This worked for me on Ubuntu 16.04
    – Canella
    Commented Feb 6, 2020 at 14:11
  • Yes, this should work. For some weird reason, the package containerd.io is missing in the docker repository and you need to install it manually. Another and perhaps simpler solution is to directly use the Ubuntu package docker.io to install docker -- all dependencies will be met. For more details see my answer askubuntu.com/a/1212388/456438
    – Dominic108
    Commented Feb 23, 2020 at 17:37
sudo snap install docker

Ubuntu 18.04 this worked for me.

Following links did not work

  1. https://docs.docker.com/install/linux/docker-ce/ubuntu/
  2. https://phoenixnap.com/kb/how-to-install-docker-on-ubuntu-18-04
  3. https://containerd.io/downloads/
  • Worked for me too under 20.04 LTS, I prefer this over curl install, thanks to point it out
    – malko
    Commented Jan 19, 2021 at 10:18
  • Now days I like to install docker using convenience script - docs.docker.com/engine/install/ubuntu/…
    – Aseem
    Commented Jan 19, 2021 at 18:00

In Ubuntu 19.10, you can install docker by installing the package docker.io, which has containerd and runc as dependencies. Alternatively, you can install docker-ce, docker-ce-cli directly from the docker repository as explained here https://docs.docker.com/install/linux/docker-ce/ubuntu/. In this alternative approach, the dependencies containerd and runc are replaced by a single dependency containerd.io. The problem is that, for some weird reason, containerd.io is not in the docker repository. So you need to install it manually as suggested in https://askubuntu.com/a/1190896/456438.

Note that containerd.io is said (in the package itself) to be a valid replacement for containerd and runc. The converse is not affirmed, but if you modify the packages docker-ce and replace the dependency for containerd.io with containerd, it works: I followed intructions in https://fabianlee.org/2018/09/28/ubuntu-customizing-and-repacking-a-deb-file/ to change the dependency in the package (without sudo):

cd $(mktemp -d -t docker-XXX)
apt download docker-ce 
ar xf docker-ce_*.deb
mkdir DEBIAN
tar xf control.tar.xz -C DEBIAN

The first command only creates a temporary directory and cd to it. The remainder extracts 5 files from the package in the DEBIAN subdirectory. I edited the file DEBIAN/control to change containerd.io to containerd and saved the file. I continued with the instructions to reconstruct the package:

tar -C DEBIAN -cJf control.tar.xz .
ar rcs docker-ce.deb debian-binary control.tar.xz data.tar.xz

This creates a new deb file docker-ce.deb in the temporary directory. I followed the instruction here https://docs.docker.com/install/linux/docker-ce/ubuntu/ but in sudo apt install ... commands I replaced containerd.io with containerd and docker-ce with ./docker-ce.deb. It worked ! Tested with docker run hello-world.


I assume you already fixed this. But for those who may have the same issue later, you can follow the simple instructions here https://docs.docker.com/engine/install/ubuntu/ Specifically, "Install from Repository".

  1. Set up the repository

    Update the apt package index and install packages to allow apt to use a repository over HTTPS:

     sudo apt-get update
     sudo apt-get install \
      apt-transport-https \
      ca-certificates \
      curl \
      gnupg-agent \
  2. Add Docker’s official GPG key:

    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

    Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88, by searching for the last 8 characters of the fingerprint.

    $ sudo apt-key fingerprint 0EBFCD88
    pub   rsa4096 2017-02-22 [SCEA]
     9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
    uid           [ unknown] Docker Release (CE deb) > <[email protected]>
    sub   rsa4096 2017-02-22 [S]
  3. Use the following command to set up the stable repository.

    sudo add-apt-repository \
     "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
     $(lsb_release -cs) \

You will most likely install docker without any issues. It helped me on Ubuntu 19.

  • didn't work for me under 20.04 => getting an exec error during postInstall
    – malko
    Commented Jan 19, 2021 at 10:20

Is there an issue opened in github for this https://github.com/docker/for-linux/issues/832 and some workarounds there. There is no stable packages for Eoan yet. Some workarounds are:

  • Manually install containerd from Ubuntu bionic (and upgrade manually when needed)
  • Use bionic repository instead
  • Use test or nightly repository instead stable.

There is a available version in snap but is too old,(18.x), and there is the docker.io package in universe repositories (19.03, not last, but newer than snap).


Edit /etc/apt/sources.list

On this line:

deb [arch=amd64] https://download.docker.com/linux/ubuntu eoan stable

Change eoan to bionic

Run sudo apt update, then retry installing docker-ce

  • not sure why this was downvoted by someone, it's a perfectly valid approach. Commented Feb 28, 2020 at 14:38

https://github.com/ratulb/k8s-easy-install/blob/docker/install-docker.sh - This would take care of adding right repositories. Verified for debian 10, ubuntu 16.04/18.04/20.04.

  • 1
    Are you associated with that Git repository?
    – Kulfy
    Commented Jan 19, 2021 at 14:35
  • Yes - that's mine. Commented Jan 20, 2021 at 11:09
  • Since you are affiliated, you must disclose that affiliation in the post. If you don't disclose affiliation, it's considered spam. See: What signifies "Good" self promotion?, some tips and advice about self-promotion, and What makes something spam.
    – Kulfy
    Commented Jan 22, 2021 at 7:57
  • Apart from that, there are many things to be fixed in your script. For example, cat abuse, unnecessary usage of sudo for reading /etc/*release, usage of Eoan Ermine (19.10) repository for 20.04 and 20.10, given that release files for latter ones exist and 19.10 reached its end of life in July 2020, etc.
    – Kulfy
    Commented Jan 22, 2021 at 8:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .