I have a GPG key which I use to sign and submit packages to Launchpad.

Is it possible to reuse that key in another installation, or do I always have to create a new key for the new installation of a GNU/Linux operating system?

2 Answers 2


Rather than copying the ~/.gnupg folder, you can create an export of your secret keys and then import on the new install, e.g.

$ gpg --export-secret-keys --output mykeys

Then on the new system:

$ gpg --import mykeys

(note: you will need to know the password associated with the keys to import them)

By exporting and importing, you allow gpg to handle any version/format differences between differing versions of gpg on the different installs.

You can use the --export option for your stored public keys in the same manner. (though I have found not including the public keys as a good way to purge all the old, non-used keys that have been collected over the years if you don't explicitly need them)


Copy ~/.gnupg to the new system

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.