更新时出现以下错误。如何修复?
sudo apt-get update
:
W: GPG error: file:/var/cuda-repo-ubuntu2204-12-1-local InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 29D5D019FDA658E8
E: The repository 'file:/var/cuda-repo-ubuntu2204-12-1-local 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 网站并进行 deb 本地安装。他们似乎已经更新了密钥
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pinsudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda-repo-ubuntu2204-12-1-local_12.1.1-530.30.02-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2204-12-1-local_12.1.1-530.30.02-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2204-12-1-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda