Linux – Options for gpg1 instead of gpg2 on CentOS/RHEL 6

centosgpglinuxredhat

I have a customer whose application workflow relies on gnupg (gpg). Their system was recently migrated from CentOS 5.x, which shipped with gnupg version 1, to CentOS 6.5, which has gnupg version 2.

While this change should have been noticed in the testing stages, it was missed by the developers, and the application is now broken.

Are there any options to run the older variant of gnupg on an EL6 system? There doesn't seem to be an obvious solution, so how can I get back to the previous version's functionality?

The nature of the issue seems to surround the gpg2 requirement of an agent. From the man page 😉

   --no-use-agent
          This is dummy option. gpg2 always requires the agent.

The relevant command string is:

# cat /home/db1/.passphrase | gpg --no-tty --passphrase-fd 0 --output xxx.TXT --decrypt xxx.pgp

The response is:

can't connect to `/home/jsmith/.gnupg/S.gpg-agent': No such file or
directory

With a helping of:

pinentry-curses: no LC_CTYPE known – assuming UTF-8

Best Answer

You can still install the gnupg (v1) package in Fedora, so it might be available in CentOS as well. You can have both gnupg and gnupg2 installed at the same time in Fedora.

Alternatively, to get gpg2 to work how you expect (i.e., for the --passphrase* options to actually do anything) you need to use the --batch option.