在安装 nvidia-container-toolkit 时,按照教程操作:
1)添加GPG密钥
# curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
2)配置nvidia-docker.list
# distribution="ubuntu16.04"
# curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | tee /etc/apt/sources.list.d/nvidia-docker.list
- 更新apt包索引
# sudo apt-get update
之后报错:
GPG error: https://download.docker.com/linux/ubuntu xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8
按照百度的指引,添加秘钥:
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 7EA0A9C3F273FCD8
结果执行 sudo apt-get update 还是报错。
后又看到可能是默认umask可能配置不正确,导致无法检测存储库公钥文件。在更新包索引之前尝试授予 Docker 公钥文件的读取权限:
sudo chmod a+r /etc/apt/keyrings/docker.gpg
sudo apt-get update
依然报错,是什么原因呢?