8

I was trying to release a Jar and the gpg-agent was not starting. According to https://www.gnupg.org/documentation/manuals/gnupg-devel/Invoking-GPG_002dAGENT.html it should start automatically on any invocation of a GnuPG program but that doesn't seem to be true in WSL.

pupeno@DESKTOP-5N8VFOD:~$ gpg-agent
gpg-agent: no gpg-agent running in this session

For a moment I thought that maybe GnuPG would just not work in WSL, but I managed to started manually:

pupeno@DESKTOP-5N8VFOD:~$ eval $(gpg-agent --daemon)
pupeno@DESKTOP-5N8VFOD:~$ gpg-agent
gpg-agent: gpg-agent running and available

So, what's missing? Why isn't it starting automatically? or how should I start it?

Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
  • Did you try running `$ gpg`? I've come across a related problem when using a yubikey where I need to kill `gpg-agent`. In this case, I simply run `$ gpg --card-edit` and it starts back up. – mikwat Apr 29 '17 at 01:44

1 Answers1

4

You want gpg-agent to start automatically, so start it from ~/.bashrc.

echo 'eval $(gpg-agent --daemon)' >> ~/.bashrc
gmarmstrong
  • 138
  • 2
  • 12
gutierri
  • 87
  • 5