Here is what I did:
cmd> export distro=ubuntu2204
cmd> export arch=x86_64
cmd> wget https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-keyring_1.0-1_all.deb
cmd> sudo dpkg -i cuda-keyring_1.0-1_all.deb
(Reading database ... 326997 files and directories currently installed.)
Preparing to unpack cuda-keyring_1.0-1_all.deb ...
Unpacking cuda-keyring (1.0-1) over (1.0-1) ...
Setting up cuda-keyring (1.0-1) ...
A deprecated public CUDA GPG key appear to be installed.
To remove the key, run this command:
sudo apt-key del 7fa2af80
cmd> sudo apt-key del 7fa2af80
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
"del" is the only subcommand of apt-key that is still supported in Ubuntu 22.04.
It appears to have worked (OK) with just a warning. But if I try to install the cuda key again I get the same error. Is this interfering key installed elsewhere and do I need to delete it from there also before I can install the new one?
The question is simple: How can I delete the key it is complaining about such that the new cuda-keyring can be installed? Hopefully I don't need to study gpg theory to do this. Yes, I have extensively googled this with queries like: 'delete gpg key from "trusted.gpg.d"' and many other variations. I consider any answer that involves some kind of forced install or forced key overwrite to also be ok.