# Updating the CUDA Linux GPG Repository Key

*Published:* 2022-04-28
*Author:* Rob Armstrong

## AI-generated summary

- NVIDIA rotated the GPG signing keys for CUDA repositories on April 27, 2022, requiring users to remove the outdated key and install the new one to avoid package management errors.
- The [cuda-keyring package](https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-keyring_1.1-1_all.deb) automates key installation for Debian-based distributions including Ubuntu and WSL.
- RPM-based distributions such as Fedora, RHEL, openSUSE, and SLES accept the new key when prompted on fresh installations, while upgrades require adding the updated repository configuration.
- Container images built on older NGC base containers may contain outdated keys; integrating the key-update commands into Dockerfiles resolves the issue.
- GPU Operator users on Ubuntu can fix GPG verification failures by updating the clusterPolicy to set driver.imagePullPolicy=Always, which pulls refreshed driver container images.

### Next Steps

- Download the [cuda-keyring package](https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-keyring_1.1-1_all.deb) to automate signing key updates on Debian-based systems.
- Add the updated [CUDA repository configuration](https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-$distro.repo) for RPM-based distribution upgrades.
- Edit the [GPG public key](https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/3bf863cc.pub) manually if the cuda-keyring package cannot be installed.

To best ensure the security and reliability of our RPM and Debian package repositories, NVIDIA is updating and rotating the signing keys used by the `apt`, `dnf/yum`, and `zypper` package managers beginning April 27, 2022.

If you don’t update your repository signing keys, expect package management errors when attempting to access or install packages from CUDA repositories.

To ensure continued access to the latest NVIDIA software, complete the following steps.

Remove the outdated signing key[](#remove_the_outdated_signing_key)
-------------------------------------------------------------------

Debian, Ubuntu, WSL

```
$ sudo apt-key del 7fa2af80
```

Fedora, RHEL, openSUSE, SLES

```
$ sudo rpm --erase gpg-pubkey-7fa2af80*
```

Install the new key[](#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[](#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.1-1_all.deb
$ sudo dpkg -i cuda-keyring_1.1-1_all.deb
```

### Alternate method: Manually install the new signing key[](#alternate_method_manually_install_the_new_signing_key)

If you can’t install the cuda-keyring package, you can install the new signing key manually (not the recommended method).

Debian, Ubuntu, WSL

```
$ sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/3bf863cc.pub
```

RPM distros[](#rpm_distros)
---------------------------

On a fresh installation, Fedora, RHEL, openSUSE, or SLES as `dnf/yum/zypper` prompt you to accept new keys when the repository signing key changes. Accept the change when prompted.

Replace `$distro/$arch` in the following commands with values appropriate for your OS; for example:

- fedora32/x86\_64
- fedora33/x86\_64
- fedora34/x86\_64
- fedora35/x86\_64
- opensuse15/x86\_64
- rhel7/ppc64le
- rhel7/x86\_64
- rhel8/cross-linux-sbsa
- rhel8/ppc64le
- rhel8/sbsa
- rhel8/x86\_64
- sles15/cross-linux-sbsa
- sles15/sbsa
- sles15/x86\_64

For upgrades on RPM-based distros including Fedora, RHEL, and SUSE, you must also run the following command.

Fedora and RHEL 8

```
$ sudo dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-$distro.repo
```

RHEL 7

```
$ sudo yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/$arch/cuda-rhel7.repo
```

openSUSE and SLES

```
$ sudo zypper removerepo cuda-$distro-$arch
$ sudo zypper addrepo https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-$distro.repo
```

Working with containers[](#working_with_containers)
---------------------------------------------------

CUDA applications built using older NGC base containers may contain outdated repository keys. If you build Docker containers using these images as a base and update the package manager or install additional NVIDIA packages as part of your Dockerfile, these commands may fail as they would on a non-container system. To work around this, integrate the earlier commands into the Dockerfile you use to build the container.

Existing containers in which the package manager is not used to install updates are not affected by this key rotation.

Working with the NVIDIA GPU Operator[](#working_with_the_nvidia_gpu_operator)
-----------------------------------------------------------------------------

If you are a current user of the GPU Operator on Ubuntu distributions, you may be affected by the rotation of the CUDA GPG keys, where some of the containers managed by the GPU Operator may fail to start with the following error:

```
Stopping NVIDIA persistence daemon... Unloading NVIDIA driver kernel modules... Unmounting NVIDIA driver rootfs... Checking NVIDIA driver packages... Updating the package cache... 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 no longer signed.
```

NVIDIA is publishing new images for the driver containers by overwriting existing image tags. You can work around this error by updating the existing `clusterPolicy` to pull new images:

```
$ kubectl edit clusterpolicy
...
set  driver.imagePullPolicy=Always
```

This step results in the GPU Operator pulling the updated images.

New installations of the GPU Operator should be unaffected by this change and do not require any `clusterPolicy` updates. If you use the GPU Operator on RHEL or OpenShift, you are also not affected by this change.

Common issues and solutions on Debian-based distros[](#common_issues_and_solutions_on_debian-based_distros)
-----------------------------------------------------------------------------------------------------------

Here are some common errors that we’ve helped people with. If you see an error not listed here, please comment below.

### Duplicate .list entries[](#duplicate_list_entries)

```
{{E: Conflicting values set for option Signed-By regarding source<br></br><a href="https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/" rel="noreferrer noopener follow" target="_self" data-wpel-link="internal">https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/</a> /: <br></br>/usr/share/keyrings/cuda-archive-keyring.gpg !=<br></br>E: The list of sources could not be read.}}
```

Solution: If you previously used `add-apt-repository` to enable the CUDA repository, then remove the duplicate entry.

```
sudo sed -i '/developer\.download\.nvidia\.com\/compute\/cuda\/repos/d' /etc/apt/sources.list
```

Also check for and remove `cuda*.list` files under the `/etc/apt/sources.d/` directory.

### <a></a>New GPG key is not enrolled[](#new_gpg_key_is_not_enrolled)

```
{{Reading package lists...<br></br>W: GPG error: <a href="https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64" rel="noreferrer noopener follow" target="_self" data-wpel-link="internal">https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64</a><br></br>InRelease: The following signatures couldn't be verified because the public key is not available:<br></br>NO_PUBKEY A4B46996 3BF863CC<br></br>E: The repository 'https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64<br></br>InRelease' is no longer signed.}}
```

Solution: See “Duplicate .list entries” notice to install cuda-keyring package OR one of the manual enrollment methods for the 3bf863cc public key.

### <a></a>Machine Learning repository[](#machine_learning_repository)

```
{{W: An error occurred during the signature verification.<br></br>The repository is not updated and the previous index files will be used.<br></br>GPG error: <a href="https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64" rel="noreferrer noopener follow" target="_self" data-wpel-link="internal">https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64</a><br></br>Release: The following signatures couldn't be verified because the public key is not available:<br></br>NO_PUBKEY F60F4B3D 7FA2AF80}}
```

Solution: Remove the NVIDIA machine learning repository entry, as it is no longer updated. Newer versions of cuDNN, NCCL, and TensorRT are available in the CUDA repository.

### <a></a>File has unexpected size[](#file_has_unexpected_size)

```
{{Packages.gz File has unexpected size (631054 != 481481). Mirror sync in progress? [IP: XXX.XXX.XXX.XXX 443]
Hashes of expected file:

* Filesize:481481 [weak]
* SHA256:8556d67c6d380c957f05057f448d994584a135d7ed75e5ae6bb25c3fc1070b0b
* SHA1:c5ea9556407a3b5daec4aac530cd038e9b490441 [weak]
* MD5Sum:a5513131dbd2d4e50f185422ebb43ac9 [weak]
* Release file created at: Mon, 25 Apr 2022 23:27:19 +0000
* E: Some index files failed to download. They have been ignored, or old ones used instead.}}
```

Solution: Report CDN issue to NVIDIA.