I've a problem with the command "gpg --gen-key". At my very first time, I connected an eMail-Account to this and everything worked fine. I can use it and so on. No Problem.

The problem is: I want to connect a second eMail-Account with a second Key and started the same command in the same way ... but NOW it tells me:

gpg: no writable public keyring found: eof
Key generation failed: eof

There is a folder: /home/accountname/.gnupg/ In this folder are several datas ... don't know if everything is like before the first key-generation.

What is the problem?

  • 2
    Permission problem? Are the files in ~/.gnupg owned by the correct user? – Celada Feb 28 '16 at 16:58
  • Yes. I didn't changed anything. I do exactly the same like I did in the first time. – cmyk Feb 29 '16 at 7:29

The easiest way would be to add another mail address to the existing key.

Open a Terminal and type:

gpg --edit-key foo.bar@bar-foo.com

GPG comment line opens up, enter the following:


In the next step you can add another Name, Address and Comment.

Confirm you action with o and Return Key. Save changes with save and Return Key.

Now you got another mail address added to your key.

The next thing to do now is setting the trust level for the new identity.


Whilst not being able to comment, I try to frame my approach as an answer...

Try to check whether the issue relates to your current .gnupg folder. For that,

mv .gnupg gnupg-backup

Then try

gpg --gen-key

again to generate your second key.

If that works, then try to import your old files

gpg --allow-secret-key-import gnupg-backup/secring.gpg
gpg --allow-secret-key-import gnupg-backup/pubring.gpg

At this point I would recommend you backup your .gnupg folder anew.

cp -r .gnupg gnupg-backup_2_keys

You can then also try to copy old configuration files, if you have them, e.g.

cp gnupg-backup/gpg* .gnupg

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.