Solvednvidia docker nvidia-docker2 has unmet dependencies that are installed

The template below is mostly useful for bug reports and support questions. Feel free to remove anything which doesn't apply to you and add more information where it makes sense.

Also, before reporting a new issue, please make sure that:


1. Issue or feature description

The following packages have unmet dependencies:
nvidia-docker2: Depends: docker-ce (= 18.03.0~ce-0~ubuntu) but 18.03.0~ce-0~ubuntu is to be installed
E: unable to correct problems, you have held broken packages.
Note that this version of docker has been installed. Furthermore, the FAQ that has been referenced in previous issues has not helped this particular instance.

2. Steps to reproduce the issue

I installed docker-ce by following the instructions in their documentation.
When I try to install nvidia-docker2 using the following command: sudo apt-get install -y nvidia-docker2 I get the error above.

3. Information to attach (optional if deemed irrelevant)

  • Kernel version from uname -a
  • Any relevant kernel output lines from dmesg
  • Driver information from nvidia-smi -a
  • Docker version from docker version
  • NVIDIA packages version from dpkg -l '*nvidia*' or rpm -qa '*nvidia*'
  • NVIDIA container library version from nvidia-container-cli -V
  • NVIDIA container library logs (see troubleshooting)
  • Docker command, image and tag used
15 Answers

✔️Accepted Answer

Me too. Here's the error I'm getting:

The following packages have unmet dependencies:
 nvidia-docker2 : Depends: docker-ce (= 18.03.0~ce-0~ubuntu) but 18.03.1~ce-0~ubuntu is to be installed or
                           docker-ee (= 18.03.0~ee-0~ubuntu) but it is not installable
E: Unable to correct problems, you have held broken packages.

Other Answers:

@STH-Dev you have the edge repository of docker-ce enabled. You should edit your /etc/apt/sources.list

Wait, which docker auto-install script?
If you're still using https://get.docker.com/, this has not been the recommended way for a long time :)

The official instructions for ubuntu will make you install the stable repository only:
https://docs.docker.com/install/linux/docker-ce/ubuntu/

More Issues: