Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to handle gpg-agent in WSL?

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?

like image 704
pupeno Avatar asked Nov 09 '22 03:11

pupeno


1 Answers

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

echo 'eval $(gpg-agent --daemon)' >> ~/.bashrc
like image 143
gutierri Avatar answered Dec 26 '22 20:12

gutierri