I have these two secret keys, only one of which is ok:

$ gpg --list-keys
pub   2048R/12345678 2016-06-30
uid                  My Name (the working one) <[email protected]>
sub   2048R/12335678 2016-06-30
pub   2048R/123ww678 2016-08-11
uid                  My Name (the not working one) <[email protected]>
sub   2048R/1234as78 2016-08-11

Now, when I try to delete a key with:

gpg --delete-secret-keys My Name

I am getting the option to delete only the working one. Why's that?

Can I delete using the ID instead of using the name?

My OS is Fedora 24.

3 Answers 3


The key identifier can be used to delete. For you, the command would be

gpg --delete-secret-key 1234as78


Yes, you can use the identifier instead of the name; that's the safest option.


The gpg --list-keys shows you your public keys, your private keys are shown using gpg --list-secret-keys.

To remove a key, you need to use the correct delete command for the type of key: gpg --delete-key [keyID] for a public key and gpg --delete-secret-key [keyID] for a private key.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .