Gnupg: Getting errors trying to gpg –gen-key

gnupggpg

I have tried deleting my .gnupg directory but the error returns.

I get this:

gpg: lookup_hashtable failed: eof
gpg: lookup_hashtable failed: eof
gpg: upd_hashtable: read failed: eof
gpg: trust record 2, type 12: write failed: eof
gpg: Error: The trustdb is corrupted.
gpg: You may try to re-create the trustdb using the commands:
gpg:   cd ~/.gnupg
gpg:   gpg2 --export-ownertrust > otrust.tmp
gpg:   rm trustdb.gpg
gpg:   gpg2 --import-ownertrust < otrust.tmp
gpg: If that does not work, please consult the manual

I tried following the advice thrown out by the error and that doesn't work either. Tried Googling the problem but nothing comes up for "lookup_hastable".

I also installed seahorse and have my ssh keys stored in seahorse. Could there be confict going on with seahorse?

I'm running gpg --gen-key from my normal user account and not trying to do anything fancy: just create a standard gpg key.

Best Answer

I faced a similar issue with lookup_hashtable failing due to Unknown system error instead.

I figured it happened after importing a private key through gpg (and not gpg2) using gpg --allow-secret-key-import --import private.key

After setting trust level following this post, the error was gone.

Related Question