更新CUDA时出现NVIDIA GPG公钥验证失败问题求助
更新CUDA时出现NVIDIA GPG公钥验证失败问题求助
问题描述
我在尝试更新CUDA时碰到了GPG公钥验证失败的报错,折腾半天没搞定,来求助啦!具体错误信息如下:
Err:1 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC W: GPG error: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC E: The repository 'https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.
解决方案
别慌,这个问题就是系统缺少NVIDIA CUDA仓库对应的GPG公钥导致的,按下面几步操作就能搞定:
手动添加缺失的公钥
打开终端,执行这条命令获取并添加公钥A4B469963BF863CC:sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A4B469963BF863CC如果遇到网络问题连不上默认密钥服务器,换个HTTP端口的试试:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys A4B469963BF863CC更新APT缓存
公钥添加好后,更新一下系统的APT缓存,让系统识别到新添加的公钥:sudo apt update重新尝试更新CUDA
现在再执行更新命令,应该就能正常进行了:sudo apt upgrade
要是还不行,可以检查下CUDA仓库的配置文件有没有问题,或者重新添加一次CUDA仓库源,但一般来说上面的步骤就能解决这个公钥缺失的问题啦!
备注:内容来源于stack exchange,提问作者Sadak




