Mailing List Archive

Having two versions of GPG on Linux causes problem
Hi,

I installed two versions of GnuPG on Ubuntu using two package managers. GPG 2.2 is installed with built-in apt and GPG 2.3 is installed with LinuxBrew. The path of LinuxBrew has priority in the $PATH so it is invoked in the terminal (which is what I want). However whenever I uses it, it shows the message “server gpg-agent is older than us (2.2.20 < 2.3.4)”. It seems that GPG 2.3 invoked the old version of gpg-agent residing in /usr/bin. I cannot delete the old gpg because it is a dependency of other software.

Running “gpgconf kill —all” won’t solve the problem, so does restarting the machine. What is strange is that running “gpgconf list” shows the correct path of all the components, including gpg-agent.

I installed two versions of GPG because I want to use the newest v2.3, which is not provided in any apt source as I know. Is there anyway to resolve the issue, or installing two versions is an undefined behaviour?

Thanks in advance

Meng
Re: Having two versions of GPG on Linux causes problem [ In reply to ]
* 2022-01-07 13:45:09+0800, foods.bolds wrote:

> I installed two versions of GnuPG on Ubuntu using two package
> managers.

> It seems that GPG 2.3 invoked the old version of gpg-agent residing in
> /usr/bin. I cannot delete the old gpg because it is a dependency of
> other software.

Probably there is a systemd unit gpg-agent.socket which listens to
connections on a socket and starts unit gpg-agent.service which starts
/usr/bin/gpg-agent. If that is the case you can override the .service
unit. Write a .conf file which overrides just the ExecStart= and
ExecReload= settings, like this:

# /etc/systemd/user/gpg-agent.service.d/my.conf
# or maybe: # ~/.config/systemd/user/gpg-agent.service.d/my.conf
[Service]
ExecStart=/usr/local/bin/gpg-agent --supervised
ExecReload=/usr/local/bin/gpgconf --reload gpg-agent

Then:

systemctl --user stop gpg-agent.service
systemctl --user daemon-reload

--
/// Teemu Likonen - .-.. https://www.iki.fi/tlikonen/
// OpenPGP: 6965F03973F0D4CA22B9410F0F2CAE0E07608462