How can I obtain the GPG pubkey when adding nvidia repository?

I have an issue installing nvidia hpc sdk. The tutorial provided by nvhpc is useful and I succesfully installed it on my own pc.
But I failed installing the hpc sdk on the workstation. The error message is “no valid opengpg data found”, or when I try “apt-get update”, the repository is not updating and shows “the following signatures couldn’t be verified because the public key is not available: NO_PUBKEY”
Both pc and workstation are running ubuntu 18.04 and I am using a docker.

Did you follow all the instructions on the download page? The error message implies that you did not add the HPC SDK public key to your keyring. I.e. this line didn’t get run on the workstation system:

% curl | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg

Thanks, jmudd.

Yes I followed the instructions on the download page.
for piped commands, I can see the ETA shown fetching the gpg keyring. but after usually 3~10 seconds, it will show the error message “no valid opengpg data found”
for individual runs, “curl” completes but “sudo gpg” is not giving any echo, the file “/usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg” is created but nothing is written in this file.

The empty keyring file implies that the public key could not be downloaded, so I would break the curl command into pieces:



cat /tmp/DEB-GPG-KEY-NVIDIA-HPC-SDK | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg

Thanks jmudd,

Again, the file “/tmp/DEB-GPG-KEY-NVIDIA-HPC-SDK” was created but the file is empty.
I think this might be the problem of network or something.
Anyway, I managed to install nvhpc with the universal way, wget the tarball, untar, install.