组件GPG代理的配置文件损坏

问题描述 投票:0回答:1

我尝试使用 gpg --full-gen-key 生成 gpg 密钥,但收到以下错误:

Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
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: error running '/opt/homebrew/Cellar/gnupg/2.4.5/bin/gpg-agent': exit status 2
gpg: failed to start gpg-agent '/opt/homebrew/Cellar/gnupg/2.4.5/bin/gpg-agent': General error
gpg: can't connect to the gpg-agent: General error
gpg: agent_genkey failed: No agent running
Key generation failed: No agent running

我接下来尝试了

pgconf --kill gpg-agent  gpgconf --launch gpg-agent
这给了我:

gpgconf: Configuration file of component GPG Agent is broken
gpgconf: Note: Use the command gpg-agent --gpgconf-test to get details.

尝试让我受益匪浅:

/Users/name/.gnupg/gpg-agent.conf:1: invalid option

我尝试卸载然后重新安装 gnupg,但没有成功。早些时候我出于某种原因做了

 rm -r ~/.gnupg
。这是把事情搞砸了吗?我该如何解决这个问题?

macos gnupg gpg-agent
1个回答
0
投票

我只需在重新安装后重新创建 gnupg 目录,因为它不会在安装时重新创建

mkdir ~/.gnupg
© www.soinside.com 2019 - 2024. All rights reserved.