macosgnupggpg-agent

Configuration file of component GPG agent is broken


I was trying to generate a gpg key to using gpg --full-gen-key, but received the following error:

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

I next tried pgconf --kill gpg-agent gpgconf --launch gpg-agent which gave me:

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

trying that gets me:

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

I tried uninstalling then reinstalling the gnupg which didn't work. Earlier I did rm -r ~/.gnupg for some reason. Is that messing things up? How would I fix this?


Solution

  • I just had to remake the gnupg directory after reinstalling since it doesn't remake it on install

    mkdir ~/.gnupg