Upon executing apt-key list, I see a key which I wish to remove.

pub   rsa2048 2017-11-24 [SC]
      3241 413F 3CE0 B919 E82F  DCA0 6239 92CF C9A9 7C2C
uid           [ unknown] John Doe <john.doe@gmail.com>
sub   rsa2048 2017-11-24 [E]

man apt-key tells me that I may delete a key by executing apt-key del keyid. It also tells me that list (aka finger) will list trusted keys with fingerprints, so I am assuming that 3241 413F 3CE0 B919 E82F DCA0 6239 92CF C9A9 7C2C is the fingerprint and not the keyid. I've messed around with gpg --list-keys and gpg --list-public-keys, however, it doesn't list any keys but creates ~/.gnupg/ with various non-text files which do not display the key IDs.

How can I identify the keyid so I may delete the key?

PS. Before asking this question, I searched for a solution, and some recommend not using "short key ids". If I should not be deleting keys by the keyid as described by man apt-key, please provide the appropriate way.


The keyid is the last 8 characters of the gpg key's fingerprint, which is that long hex-code under pub

In your case it is: sudo apt-key del C9A97C2C


  • Thanks Mark, I had actually seen that post, but considering that man apt-key does not also mirror this information, it made me question whether I am actually doing this correct by using the frowned upon short key ID. – user1032531 Jan 31 '18 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.