I use keychain to setup my ssh-agent and gpg-agent sessions so that it remembers my passphrases and I don't have to retype them every time I use them. But recently I was getting this error:
Error: Problem adding (is pinentry installed?); giving up
/usr/bin/keychain I found that it was having trouble running
gpg --use-agent --no-tty --sign. Running that directly gave me this error:
gpg: problem with the agent - disabling agent use
gpg: Sorry, no terminal at all requested - can't get input
The problem turned out to be
~/.gnupg/gpg-agent.conf had an old entry
pinentry-program /usr/bin/pinentry-gtk which didn't exist any more. Change that entry to
/usr/bin/pinentry or delete it altogether. Note: you'll have to restart gpg-agent (
killall gpg-agent && eval `gpg-agent --daemon`) for changes to gpg-agent.conf to take effect.
Hope this helps somebody, since none of my googling found this solution.