Fix "The following signatures couldn't be verified because the public key is not available" for nvidia-docker

 

Error: Nvidia-docker’s signatures couldn’t be verified

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://nvidia.github.io/libnvidia-container/ubuntu18.04/amd64  InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6ED91CA3AC1160CD
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://nvidia.github.io/nvidia-container-runtime/ubuntu18.04/amd64  InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6ED91CA3AC1160CD
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://nvidia.github.io/nvidia-docker/ubuntu18.04/amd64  InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6ED91CA3AC1160CD

Reason

The local GPG key is expired. Just fetch the latest key from nvidia

Solution: for Ubuntu

Update GPG public key via:

curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -

Other platforms

Repository configuration

In order to setup the nvidia-docker repository for your distribution, follow the instructions below.

If you feel something is missing or requires additional information, please let us know by filing a new issue.

List of supported distributions:

  Ubuntu 14.04 Ubuntu 16.04 Ubuntu 18.04 Debian 8 Debian 9 Debian 10 Centos 7 RHEL 7 Amazon Linux 1 Amazon Linux 2
x86_64 X X X X X X X X X X
ppc64le   X X              

Debian-based distributions

curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
  sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
  sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update

RHEL-based distributions

distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.repo | \
  sudo tee /etc/yum.repos.d/nvidia-docker.repo

Updating repository keys

In order to update the nvidia-docker repository key for your distribution, follow the instructions below.

RHEL-based distributions

$ DIST=$(sed -n 's/releasever=//p' /etc/yum.conf)
$ DIST=${DIST:-$(. /etc/os-release; echo $VERSION_ID)}
$ sudo rpm -e gpg-pubkey-f796ecb0
$ sudo gpg --homedir /var/lib/yum/repos/$(uname -m)/$DIST/*/gpgdir --delete-key f796ecb0
$ sudo gpg --homedir /var/lib/yum/repos/$(uname -m)/latest/nvidia-docker/gpgdir --delete-key f796ecb0
$ sudo gpg --homedir /var/lib/yum/repos/$(uname -m)/latest/nvidia-container-runtime/gpgdir --delete-key f796ecb0
$ sudo gpg --homedir /var/lib/yum/repos/$(uname -m)/latest/libnvidia-container/gpgdir --delete-key f796ecb0
$ sudo yum update

Amazon Linux (1 and 2)

Be careful to run each instruction one by one!

$ sudo gpg --homedir /var/lib/yum/repos/$(uname -m)/*/nvidia-docker/gpgdir --delete-key f796ecb0
$ sudo gpg --homedir /var/lib/yum/repos/$(uname -m)/*/nvidia-container-runtime/gpgdir --delete-key f796ecb0
$ sudo gpg --homedir /var/lib/yum/repos/$(uname -m)/*/libnvidia-container/gpgdir --delete-key f796ecb0
$ sudo yum update

Debian-based distributions

curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
  sudo apt-key add -

Ref

https://nvidia.github.io/nvidia-docker/

https://github.com/NVIDIA/nvidia-docker/wiki/Frequently-Asked-Questions#im-getting-the-following-signatures-were-invalid-expkeysig-while-trying-to-install-the-packages-what-do-i-do