我无法通过密钥环程序生成GPG密钥。

每当我尝试通过系统的GPG程序生成一个gpg密钥时,它会要求我的姓名、电子邮件和密码,然后除了GPG程序的主窗口外,其他所有东西都消失了。
在使用`gpg key-gen`之后。
gpg: can't open `/home/jesse/.gnupg/random_seed': Permission denied
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
gpg: WARNING: some OpenPGP programs can't handle a DSA key with this digest size
+++++++++++++++..++++++++++...+++++++++++++++.+++++..+++++.+++++.++++++++++.+++++++++++++++..+++++.++++++++++++++++++++.++++++++++++++++++++++++++++++.+++++.+++++.+++++...+++++>+++++...+++++++++++++++++++++++++..+++++++++++++++>.+++++>+++++................................................................................................................................................................................................................................................................................>.+++++.................................................................................................................+++++

Not enough random bytes available.  Please do some other work to give
the OS a chance to collect more entropy! (Need 300 more bytes)
gpg: no writable public keyring found: eof
Key generation failed: eof
gpg: note: random_seed file not updated
2个回答

对我来说,删除.gnugpg文件夹有帮助:
sudo rm -rf ~/.gnugpg

那最终对我起作用的就是这个。我一定忘记回来把答案放在这里了。谢谢你的回复。 - KI4JGT
这在17.10版本上对我没起作用。 - Danny van der Knaap

在您以root身份运行gpg后,权限可能会出现问题,导致无法以普通用户"joey"的身份修改某些文件。
find ~/.gnupg -type d -exec sudo chown joey:joey {} \; -exec chmod 700 {} \;
find ~/.gnupg -type f -exec sudo chown joey:joey {} \; -exec chmod 600 {} \;

如果你不想删除任何现有的键,这将会很有帮助。

3该位置上的插座也应该归$USER:$USER所有吗?你可以直接使用$USER:$USER,即你当前的用户。 - Pablo Bianchi