我是Docker新手,对Linux的工作经验有限。尝试增加GIT项目(一个托管在Github上的机器学习项目)。该项目使用GPU (Nvidia),依赖于Docker和nvidia-docker2,并使用Python (3.5)进行编码。
在README.md之后,我成功地继续工作,直到在安装nvidia-docker2时出现错误。( readme.me的第一部分-直到并包括安装nvidia-docker2 -在上面的链接中)。
详细说明一下,README.md文件有一个关于如何运行项目的一步一步的集成指南,它从安装nvidia驱动程序和其他库开始,我可以安装并验证它们是否正常工作。但是当涉及到nvidia-docker2的安装时:
sudo apt-get install -y nvidia-docker2我得到以下错误:
The following packages have unmet dependencies:
nvidia-docker2 : Depends: docker-ce (= 18.03.1~ce~3-0~ubuntu) but
18.05.0~ce~3-0~ubuntu is to be installed or
docker-ee (= 18.03.1~ee~3-0~ubuntu) but it is not 欢迎任何有帮助的评论!请看下面的一些进一步的阐述,在文章的结尾,我描述了我为解决这个问题所做的一些尝试。
谢谢!
Some阐述:
我到达了我必须安装码头的部分,它运行得很好(引用README.md的话):
sudo apt-get update
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 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 docker run hello-world
sudo usermod -a -G docker $USER它工作得很好,我可以证实:
sudo apt-get install -y nvidia-docker2所以当我检查
sudo docker version我得到了我所拥有的仿生ubuntu的莱茨码头。
Client:
Version: 18.05.0-ce
API version: 1.37
Go version: go1.9.5
Git commit: f150324
Built: Wed May 9 22:16:13 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.05.0-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.9.5
Git commit: f150324
Built: Wed May 9 22:14:23 2018
OS/Arch: linux/amd64
Experimental: false然后,我可以检查是否设置了码头并运行:
sudo docker run hello-world所以我得到:
Hello from Docker!
[...]However,当我继续到README.md上的下一个指令块时,我必须安装 nvidia-docker2 I获得一个错误:
我跑
docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -f
sudo apt-get purge -y nvidia-docker
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最后:
sudo apt-get install -y 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 (= 18.03.1~ce~3-0~ubuntu) but 18.05.0~ce~3-0~ubuntu is to be installed or
docker-ee (= 18.03.1~ee~3-0~ubuntu) but it is not installable
E: Unable to correct problems, you have held broken packages.What我试图解决这个问题:
nvidia-docker2在Ubuntu18.04上还不受支持吗?docker.io而不是docker-ce,这将解决nvidia-docekr2问题。我遵循他的建议,即安装docker.io (我还编辑了摇滚重新推荐的/etc/apt/sources.list )。然后我可以验证我是否成功地安装了docker.io,即:。
sudo docker version
Client:
Version: 17.12.1-ce
API version: 1.35
Go version: go1.10.1
Git commit: 7390fc6
Built: Wed Apr 18 01:23:11 2018
OS/Arch: linux/amd64
Server:
Engine:
Version: 17.12.1-ce
API version: 1.35 (minimum version 1.12)
Go version: go1.10.1
Git commit: 7390fc6
Built: Wed Feb 28 17:46:05 2018
OS/Arch: linux/amd64
Experimental: false这是最新的docker.io在ubuntu上的包裹。但是我仍然有一个错误(尽管报告有点不同)。
sudo apt-get install -y nvidia-docker2
The following packages have unmet dependencies:
nvidia-docker2 : Depends: docker-ce (= 18.03.1~ce~3-0~ubuntu) but it is not
going to be installed or
docker-ee (= 18.03.1~ee~3-0~ubuntu) but it is not installable
E: Unable to correct problems, you have held broken packages.发布于 2018-06-28 09:09:48
我通过安装特定的docker-ce (社区版)包而不是最新版本(18.05版)解决了这个问题。
sudo apt-get install -y docker-ce=18.03.13-0~ubuntu安装docker-ce的完整说明可在https://docs.docker.com/install/linux/docker-ce/ubuntu/上找到。
https://unix.stackexchange.com/questions/451667
复制相似问题