安装nvidia-docker2报错E: Unable to locate package nvidia-docker2

一、Ubuntu18.04安装nvidia-docker2

安装时参考的博客如下:https://blog.csdn.net/BigData_Mining/article/details/99681168

二、报错信息

执行安装nvidia-docker2步骤时:

root@docker:~# sudo apt-get install nvidia-docker2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package nvidia-docker2

我的环境如下:

root@docker:~# docker --version
Docker version 19.03.12, build 48a66213fe
root@docker:~# uname -a
Linux docker 5.4.0-42-generic #46~18.04.1-Ubuntu SMP Fri Jul 10 07:21:24 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

三、解决该问题

完整执行命令如下:

$ curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
  sudo apt-key add -
$ distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
$ curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
  sudo tee /etc/apt/sources.list.d/nvidia-docker.list
$ sudo apt-get update

安装nvidia-docker2报错E: Unable to locate package nvidia-docker2_第1张图片
# 安装nvidia-docker2软件包并重新加载docker守护程序配置
$ sudo apt-get install -y nvidia-docker2
$ sudo pkill -SIGHUP dockerd

安装nvidia-docker2报错E: Unable to locate package nvidia-docker2_第2张图片

到此“E: Unable to locate package nvidia-docker2”问题就解决了,可以继续执行安装教程后续的命令。

你可能感兴趣的:(docker,linux,ubuntu,python,java)