I've added a lot of keys to my Ubuntu 20.04 computer and when I issue the gpg --list-keys
command in my terminal I only get silent output (ie nothing is returned). sudo gpg --list-keys
doesn't list any of my keys either. What am I doing wrong?
I've added a lot of keys to my Ubuntu 20.04 computer and when I issue the gpg --list-keys
command in my terminal I only get silent output (ie nothing is returned). sudo gpg --list-keys
doesn't list any of my keys either. What am I doing wrong?
When a user uses
gpg
orgpg2
to import public keys, the keys are stored in the public keyring that is in~/.gnugpg
by default. If you usedapt-key
the public keys are stored in individual.gpg
files in/etc/apt/trusted.gpg.d/
. The following command runs thegpg
command without arguments for each gpg file in/etc/apt
to cover cases where the name of the folder is different from the default. Gpg guesses what output you want based on the content of the file passed as argument:The following alternative command sets each file as the keyring and ignores the default keyring, this way you can replace the
--list-public-keys
by--export --armor
to export public keys to text format: