gpg-agent: a gpg-agent is already running - not starting a new one

1

Trying to configure gpg in a way that I enter passphrase only once, and it will work for the whole session.

However, this is what I'm getting:

$ pgrep gpg-agent | wc 
      0       0       0

$ gpg-agent --daemon
gpg-agent: a gpg-agent is already running - not starting a new one

$ pgrep gpg-agent
26401

I.e., gpg-agent --daemon will start a gpg-agent but forgot it has started one right afterward, and blocks itself. Tried many times after gpgconf --kill gpg-agent, or

kill `pgrep gpg-agent`

and the results are always the same.

What's wrong?

$ lsb_release -a 
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:        18.04
Codename:       bionic

 # installed packages with KW of gpg:
 gpg_2.2.4-1ubuntu1.2
 gpg-agent_2.2.4-1ubuntu1.2
 gpg-wks-client_2.2.4-1ubuntu1.2
 gpg-wks-server_2.2.4-1ubuntu1.2
 gpgconf_2.2.4-1ubuntu1.2
 gpgsm_2.2.4-1ubuntu1.2
 gpgv_2.2.4-1ubuntu1.2

xpt

Posted 2019-05-18T14:44:30.067

Reputation: 5 548

@harrymc, thx. I took a look at that answer as per your suggestion, but found one important aspect of info missing -- how can gpg replace ssh-agent? I'm using ssh-agent forwarding and doing things on remote server. I need to keep the forwarded ssh auth, otherwise, I'll use keychain to simplify the whole situation, without even installing that extra OpenPGP Card component, as the linked doc required.

– xpt – 2019-05-18T15:22:32.990

Moreover, regardless how fancy the situation is, with or without that extra OpenPGP Card component, the gpg-agent --daemon is still need to be called & started, with or without the extra --enable-ssh-support passed on the command-line. However this situation here is that gpg-agent --daemon can't even get started. – xpt – 2019-05-18T15:34:04.803

@karel, if you look closely, you will find that the link you provided is exactly the same as harrymc provided, and all my explanations were why they are not the same. harrymc has since retreated his "possible duplicate" suggestion. – xpt – 2019-05-18T18:14:16.873

No answers