I re-imported the PGP key into new system install. Now when I try to decrypt my backup text file, Ubuntu warns me

Decryption Failed. You probably do not have the decryption key.

Please help, I am new to Ubuntu.


Missing Private Keys

GnuPG cannot find your private key, at least not the one for decrypting.

Do gpg --list-secret-keys. Is your key listed? If it is, do

gpg --edit [your-key-id-listed-above]

It will include more detailed information on your key. Is there a subkey whose line is ending with "E" for encryption?

If that fails, make sure once again you imported to the right key ring (each user has it's own, and you could add another keyring if you want somewhere else -- most easy way would be to import the key again.

If this also fails, you probably didn't export the private keys. Try to look at the headers of the exported file, if it is ascii-armored, you should read something like


If you only exported the public key, you will read PUBLIC instead.

How to Recover My Secret Keys?

You cannot recalculate them from your public keys. If you could, everybody would be able to!

Surely you've got a backup of your old user folder. Recover it somewhere and use gpg --homedir /path/to/old/.gnupg -a --export-secret-keys [your-key-id] >~/secret-key.asc to export your private key from it which you can reimport to your new keyring.

If you haven't got the key any more, you should send your revocation certificate to the keyservers now. Now the keyservers say you're not using that key any more and you can create a new one without old "garbage" on the keyservers.

If you haven't got a revocation certificate, you will not be able to erase that key from the keyservers.

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.