Nvidia-docker: Can not install nvidia-docker2 under Ubuntu18.04 by default

Created on 17 Dec 2018  路  7Comments  路  Source: NVIDIA/nvidia-docker

1. Issue or feature description

Can not install nvidia-docker2 under Ubuntu18.04

2. Steps to reproduce the issue

$ 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

3. Information to attach (optional if deemed irrelevant)

I believe it's not necessary.

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 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!

All 7 comments

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 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! =)

Was this page helpful?
0 / 5 - 0 ratings