I have a backup image mounted at /mnt. I need to recover (and revoke) a key in the secret keyring on this backup.

How can I list keys and generate a revocation key for a key stored in this other keyring?

When I do:

gpg --homedir /mnt/home/naftuli/.gnupg --list-keys

I see the keys installed locally and not the keys installed in the backup's keyring.

What's really strange is that if I chroot to the /mnt folder and run gpg --list-keys, I still see the keys in the other keyring.

Any ideas?

  • have you tried HOME=/mnt/home/naftuli/ gpg --list-keys?
    – hildred
    Commented Dec 5, 2013 at 22:54
  • Same thing. It shows the results from the other keyring. One of the keys was just generated today, and the backup is from 2013/11/29, so the new key really shouldn't be in that backup. Commented Dec 5, 2013 at 22:56
  • do you have any absolute paths in /mnt/home/naftuli/.gnupg/gpg.conf? what does ls -lnd /mnt/home/naftuli/ /home/naftuli/ say?
    – hildred
    Commented Dec 5, 2013 at 23:00
  • 3
    You probably have gpg-agent running, and are listing keys in the agent. Try --no-use-agent
    – derobert
    Commented Dec 5, 2013 at 23:06
  • Looks like something weird was going on, the mounted directory was a loop for some reason to /. No idea why, but working around it. Commented Dec 5, 2013 at 23:08

2 Answers 2


no need to chroot, I often generate wot maps / diagrams from a separate gpg db than my main, (for example a work team). to do this export GNUPGHOME

export GNUPGHOME=/mnt/home/naftuli
gpg --list-keys

If chrooting, killing the agent, etc. don't work for you, swap the gpg folders, and reboot.

If you still see your new keys, something isn't right in your setup, or the folder paths are not what you think they are.

You must log in to answer this question.

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