[问题已处理]-ubuntu20.04安装Nvidia-docker2报的各种问题

导语:使用如下命令安装nvidia-docker时报错

distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
      && curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
      && curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | \
            sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
            sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
            
curl -s -L https://nvidia.github.io/libnvidia-container/experimental/$distribution/libnvidia-container.list | \
    sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
    sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list

sudo apt-get update
sudo apt-get install -y nvidia-docker2

nvidia-docker2 : Depends: docker-ce (>= 18.06.0ce3-0~ubuntu) but it is not installable or

直接安装报错如下

apt-get install docker-ce=18.06.1~ce~3-0~ubuntu containerd.io

E: Version ‘18.06.0ce3-0~ubuntu’ for ‘docker-ce’ was not found

解决方式

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - \
    && sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable" \
    && sudo apt-get update \
    && sudo apt-get install docker-ce=18.03.1~ce-0~ubuntu -yq

nvidia-docker2官方安装文档

https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker

参考

https://stackoverflow.com/questions/49714469/docker-version-18-03-0-ce-for-docker-ce-was-not-found

你可能感兴趣的:(问题已处理,运维)