How do I delete secret subkeys correctly?

Matheus Afonso Martins Moreira matheus.a.m.moreira at
Fri Apr 12 05:09:27 CEST 2019

> I was trying to figure out how to do it through the user interface, and
> it's pretty clunky, with some scary failure modes.  I've opened
> about it.

Thank you!

> I know that with the version of GnuPG that you're using right now, you
> can delete the secret key by learning its keygrip and asking gpg-agent
> to delete it for you.

This seems to be the definitive answer for gpg 2.2.15.
Also interesting is the --stub-only option,
which deletes the key only if it is a reference to a token.

More information about the Gnupg-users mailing list