Huan
Huan

Reputation: 3247

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

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

Upvotes: 2

Views: 4873

Answers (1)

Huan
Huan

Reputation: 3247

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

Related to https://github.com/NVIDIA/nvidia-docker/issues/887

Upvotes: 4

Related Questions