Docker 未满足的依赖项:nvidia-docker2

Docker Unmet dependencies: nvidia-docker2

当我运行以下命令时:

sudo apt-get install -y nvidia-docker2

我收到以下错误响应:

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

/etc/apt/sources.list中确保最后一个字是稳定的,而不是边缘

deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable

在我的例子中,/etc/apt/sources.list 中缺少上述行。我将它添加到底部并执行了以下命令:

那么通常:

sudo apt-get update

sudo apt-get install -y docker-ce

验证您的 docker 版本:

sudo docker version