I have checked several times that I didn't mess up the export files. (I in fact did import the public key and not by accident the secret key.)
When I am searching for secret GPG keys on my system in the command line I can find the second private key (that shouldn't even be there) after importing the public key. But when I attempt to delete it GPG claims that it doesn't exist. (I can also find it using the Seahorse/Passwords app and when I delete it there using the GUI it looks like it is gone. Even on the command line it doesn't show up any longer.) But each time I import the public key the secret key magically returns too.
Do you have an Idea what I could do to get rid of the somewhat obscure hidden secret key on my system?
Code: Select all
$ gpg --list-secret-keys
/home/user/.gnupg/pubring.kbx
-------------------------------------
sec rsa4096 2010-01-01 [SC]
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
uid [ultimate] Name <name@mail.com>
ssb rsa4096 2010-01-01 [E]
sec# rsa4096 2020-01-01 [SC]
YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
uid [ultimate] Name2 <name2@mail.com>
ssb rsa4096 2020-01-01 [E]
$ gpg --delete-secret-key YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
gpg (GnuPG) 2.2.40; Copyright (C) 2022 g10 Code GmbH
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
gpg: key "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" not found
gpg: YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY: delete key failed: Not found