Problem:
Get:8 https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu1804/x86_64 InRelease [1,581 B]
Err:8 https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu1804/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.cn/compute/cuda/repos/ubuntu1804/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/ubuntu1804/x86_64 InRelease' is no longer signed.
Solution:
Remove the outdated signing key
Debian, Ubuntu, WSL
$ sudo apt-key del 7fa2af80
Install the new key
For Debian-based distributions, including Ubuntu, you must also install the new package or manually install the new signing key.
Install the new cuda-keyring package
To avoid the need for manual key installation steps, NVIDIA is providing a new helper package to automate the installation of new signing keys for NVIDIA repositories.
Replace $distro/$arch
in the following commands with values appropriate for your OS; for example:
- debian10/x86_64
- debian11/x86_64
- ubuntu1604/x86_64
- ubuntu1804/cross-linux-sbsa
- ubuntu1804/ppc64el
- ubuntu1804/sbsa
- ubuntu1804/x86_64
- ubuntu2004/cross-linux-sbsa
- ubuntu2004/sbsa
- ubuntu2004/x86_64
- ubuntu2204/sbsa
- ubuntu2204/x86_64
- wsl-ubuntu/x86_64
Debian, Ubuntu, WSL
$ wget https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-keyring_1.0-1_all.deb
$ sudo dpkg -i cuda-keyring_1.0-1_all.deb
Remove leftover sources.list items
If run sudo apt update now, the following error will pop up:
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: file:/var/cuda-repo-10-2-local-10.2.89-440.33.01 Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F60F4B3D7FA2AF80
W: Failed to fetch file:/var/cuda-repo-10-2-local-10.2.89-440.33.01/Release.gpg The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F60F4B3D7FA2AF80
"F60F4B3D 7FA2AF80" is the key we just removed. The above error is due to the leftover not cleaned up. To clean up:
sudo sed -i '/developer\.download\.nvidia\.com\/compute\/cuda\/repos/d' /etc/apt/sources.list
sudo rm /etc/apt/sources.list.d/cuda*.list
All done, check for errors
sudo apt update
apt list --upgradable
sudo apt upgrade