Invalid public key for CUDA apt repository

We’re in the process of updating the Docker images and Dockerfiles, but I don’t have an ETA at hand for any specific container image.

1 Like

The following works in pytorch docker (cuda-keyring_1.0-1_all.deb file was downloaded with wget outside of docker first):

from pytorch/pytorch:1.10.0-cuda11.3-cudnn8-devel as builder

COPY ./cuda-keyring_1.0-1_all.deb cuda-keyring_1.0-1_all.deb

RUN rm /etc/apt/sources.list.d/cuda.list
&& rm /etc/apt/sources.list.d/nvidia-ml.list
&& dpkg -i cuda-keyring_1.0-1_all.deb

RUN apt-get update

This worked for me, thank you! Key was indeed to download the key outside of docker.

Same problem for me, just started today. Cannot do apt-get update :(

W: GPG error: Index of /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 ‘Index of /compute/cuda/repos/ubuntu1804/x86_64 InRelease’ is not signed.

Adding the following seems to fix it:
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub

6 Likes

Unless RUN is an alias to sudo your solution would be better stated as;

$ sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
$ sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub

Though I suspect that second line is only if you have machine learning stuff.

18 Likes

OK it worked

It worked, thank you! I only ended up needing first command to get my stuff working again!

Just wanted to pull your coat about the fact that the post in the Announcements category references a directory tree on the server for use with Ubuntu 22.04 “The Jammy Jellyfish”, however no such path is being served.

1 Like

I am facing same issue as well. I started NVIDIA VM in azure and not able to run apt update because of publickey error. Also tried running sudo apt-key adv --recv-keys --keyserver keys.gnupg.net A4B469963BF863CC to get keys but its giving rror for No data… How do i fix it ?
I am using ubuntu 20.04

Same issue here:

GPG error: Index of /compute/cuda/repos/ubuntu2004/x86_64 InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC

Found myself in a Catch 22 using Docker container nvidia/cuda:11.3.1-cudnn8-runtime-ubuntu20.04
This works:
RUN apt-key del 7fa2af80

But, you still can’t run apt update after that, because the container still holds the invalidated nvidia repos, so I had to:

RUN apt-key del 7fa2af80 \
    && rm /etc/apt/sources.list.d/nvidia-ml.list /etc/apt/sources.list.d/cuda.list

After that you can update and apt install wget, to do:

RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb \
    && dpkg -i cuda-keyring_1.0-1_all.deb

All was fine for me after that! So I believe someone needs to update the containers themselves for this to start working again. Hope this helps someone.

2 Likes

Hey. I have the same issue without root privileges. How to tackle this issue without sudo?

I am trying to build and store a singularity-container on sylabs. I am using clustersystem were I don’t have any privileges. Thanks

singularity build --remote library://A/B/C.sif:latest C.def

Reading package lists…
W: GPG error: Index of /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 ‘REPOLINK InRelease’ is not signed.
FATAL: While performing build: while running engine: exit status 100

RUN (all capitals) is typically the way the docker run command is written. Depending on the state during the container build the command could be executed as root or another user.

This is was my fix:

RUN apt-key del 7fa2af80 \
    && apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/3bf863cc.pub \
    && apt-get update \
    && apt-get install -y libsm6 libgl1-mesa-glx libxext6 libfontconfig1 libxrender1 \
    && rm -rf /var/lib/apt/lists/*    && rm -rf /var/lib/apt/lists/*

Adjust the second to last line where additional packages are installed to reflect your Dockerfile.

1 Like

Sorry for the noob-question (I am a mechanical engeneer in numerical analysis’ - the craft of computer science is not native to me). I don’t know where to execute the code. I am building the singularity container from a singularity *.def. When is docker available in the building process of singularity?

EDIT: Thanks a lot. Now i got it and it works.

Do these file names stay the same and their contents change? Wondering if this would work as a long term solution to solve for key rotations. Don’t want to hardcode the filenames and then have this fail in 3 months.

This worked for me as well.

Below steps helped to fix the nvidia baseos repo GPG error:
sudo apt-key adv --fetch-keys https://repo.download.nvidia.com/baseos/GPG-KEY-dgx-debian-prod

sudo apt-get update

This still looks to be an issue

{"changed": false, "msg": "Failure downloading https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb, HTTP Error 404: Not Found"}

Hi @cpierre, the CUDA repository for Ubuntu 22.04 support is not yet live. Check back at the next release.