Sample Header Ad - 728x90

GPG key is not getting generated : agent_genkey in gpg is looking for some file

2 votes
2 answers
2884 views
I'm facing issue to generate gpg key on my mac(10.15.7 Catalina). It is showing some error that the agent_genkey is looking for some file which is not available. Below is the debug information from that : % gpg --gen-key -vvvvv gpg (GnuPG) 2.3.1; Copyright (C) 2021 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. gpg: using character set 'utf-8' gpg: Note: RFC4880bis features are enabled. gpg: directory '/Users/test/.gnupg' created gpg: keybox '/Users/test/.gnupg/pubring.kbx' created Note: Use "gpg --full-generate-key" for a full featured key generation dialog. GnuPG needs to construct a user ID to identify your key. Real name: test name Email address: testname@gmail.com You selected this USER-ID: "test name " Change (N)ame, (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: no running gpg-agent - starting '/usr/local/Cellar/gnupg/2.3.1/bin/gpg-agent' gpg: waiting for the agent to come up ... (5s) gpg: connection to the agent established gpg: pinentry launched (12023 curses 1.1.1 /dev/ttys002 xterm-256color - ? 502/20 0) gpg: agent_genkey failed: No such file or directory Key generation failed: No such file or directory gpg version is 2.3.1 and git version is 2.30.0. % gpg --version gpg (GnuPG) 2.3.1 libgcrypt 1.9.3 I have tried suggestions given in various post : like deleting the home directory (~/.gnupg), stopping the gpg-agent, reinstalling the gpg package (using brew). It had worked around 1 month back. There was some issue with the previous keys . So, I had to delete those all and generate fresh and that is where the problem started. Before reinstalling it, it was timing out in generation of gpg key . I had ran dd commands to help generate randomness. But that did not work either.
Asked by Learner (297 rep)
Apr 27, 2021, 04:24 PM
Last activity: Feb 13, 2025, 09:53 AM