Can not install nvidia-docker2 under Ubuntu18.04
$ cat /etc/issue
Ubuntu 18.04.1 LTS \n \l
$ docker --version
Docker version 18.06.1-ce, build e68fc7a
$ sudo apt install nvidia-docker2
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:
nvidia-docker2 : Depends: docker-ce (= 5:18.09.0~3-0~ubuntu-bionic) but it is not installable or
docker-ee (= 5:18.09.0~3-0~ubuntu-bionic) but it is not installable
E: Unable to correct problems, you have held broken packages.
$ uname -a
Linux zixia-desktop 4.15.0-42-generic #45-Ubuntu SMP Thu Nov 15 19:32:57 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
I believe it's not necessary.
Remove the default docker.io and install Docker from docker official repository.
The script as the following:
sudo apt-get remove docker docker-engine docker.io
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install docker-ce
sudo apt-get install nvidia-docker2
sudo apt-get install docker-nvidia2
Thanks @hzxie for mention the above fix!
Hello!
Docker.io doesn't install the latest version of docker meaning that you need to pin the nvidia-docker version when trying to install nvidia-docker:
https://github.com/NVIDIA/nvidia-docker/wiki/Frequently-Asked-Questions#how-do-i-install-20-if-im-not-using-the-latest-docker-version
Thanks!
sudo apt-get install docker-ce
sudo apt-get install nvidia-docker2 #not sudo apt-get install "docker-nvidia2"
@huan
Please change
sudo apt-get install docker-nvidia2
to
sudo apt-get install nvidia-docker2
Thanks for reminding me to the fix.
Updated.
Many thanks for this fix!
The Solution
Remove the default docker.io and install Docker from docker official repository.
The script as the following:
sudo apt-get remove docker docker-engine docker.io sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo apt-key fingerprint 0EBFCD88 sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable" sudo apt-get install docker-ce sudo apt-get install nvidia-docker2~sudo apt-get install docker-nvidia2~
Don't forget to add the "sudo apt-get update" after you've added a new repo to your lists! =)
Most helpful comment
The Solution
Remove the default docker.io and install Docker from docker official repository.
The script as the following:
sudo apt-get install docker-nvidia2