I downloaded the latest stable tarball from https://www.gnupg.org/download/ and extracted it to a folder on my ubuntu machine. I had to chmod 775 configure in order to be able to run it, then I ran ./configure

I got this message right at the end:

    GnuPG v2.0.29 has been configured as follows:


    Revision:  120fc69  (4623)
    Platform:  GNU/Linux (x86_64-unknown-linux-gnu)


    OpenPGP:   yes
    S/MIME:    yes
    Agent:     yes 
    Smartcard: yes (without internal CCID driver)
    Gpgtar:    no


    Protect tool:      (default)
    Default agent:     (default)
    Default pinentry:  (default)
    Default scdaemon:  (default)
    Default dirmngr:   (default)


    Warning: Mismatches between the target platform and the
             to be used libraries have been detected for:
               libgpg-error libgcrypt
             Please check above for more warning messages.

I tried to run a sudo apt-get install libgpg-error libgcrypt but it said they couldn't be found, so I tried libgpg-error-dev libgcrypt-dev and got this:

Reading package lists...
Building dependency tree...
Reading state information...
libgpg-error-dev is already the newest version.
libgcrypt11-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 69 not upgraded.

So I tried to run make and this is what I saw at the very end

Making all in .
make[3]: Entering directory `/home/nitrous/gnupg-new/tests'
srcdir=. GNUPGHOME=`/bin/pwd` GPG_AGENT_INFO= LC_ALL=C GPGSM=../sm/gpgsm ./runtest ./inittests
make[3]: Leaving directory `/home/nitrous/gnupg-new/tests'
make[2]: Leaving directory `/home/nitrous/gnupg-new/tests'
make[1]: Leaving directory `/home/nitrous/gnupg-new'
/bin/bash: ./runtest: permission denied
make[3]: *** [inittests.stamp] Error 126
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Making all in .
make[3]: Entering directory `/home/nitrous/gnupg-new/tests'
srcdir=. GNUPGHOME=`/bin/pwd` GPG_AGENT_INFO= LC_ALL=C GPGSM=../sm/gpgsm ./runtest ./inittests
/bin/bash: ./runtest: Permission denied
make[3]: *** [inittests.stamp] Error 126
make[3]: Leaving directory `/home/nitrous/gnupg-new/tests'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/nitrous/gnupg-new/tests'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/nitrous/gnupg-new'
make: *** [all] Error 2

I then ran make install and got the same error at the end. What is going wrong?

Edit:

I've manually compiled and installed libgpg-error and libgcrypt, the ./configure went fine without any warnings, when I ran sudo make I got this at the end:

chmod 755 ./gpg_dearmor
./gpg_dearmor > ./pubring.gpg < ./pubring.asc
../../g10/gpg2: error while loading shared libraries: libgcrypt.so.20: cannot open shared object file: No such file or directory
make[3]: *** [pubring.gpg] Error 127
make[3]: Leaving directory `/home/nitrous/gnupg-new/tests/openpgp'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/nitrous/gnupg-new/tests'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/nitrous/gnupg-new'
make: *** [all] Error 2

Then when I tried make install again, I got this:

Making install in tests
make[1]: Entering directory `/home/nitrous/gnupg-new/tests'
Making install in openpgp
make[2]: Entering directory `/home/nitrous/gnupg-new/tests/openpgp'
./gpg_dearmor > ./secring.gpg < ./secring.asc
../../g10/gpg2: error while loading shared libraries: libgcrypt.so.20: cannot open shared object file: No such file or directory
make[2]: *** [secring.gpg] Error 127
make[2]: Leaving directory `/home/nitrous/gnupg-new/tests/openpgp'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/nitrous/gnupg-new/tests'
make: *** [install-recursive] Error 1

Edit 2:

I found a post that said to run sudo ldconfig -v

And then when I ran ./configure and sudo make install again I was given this error at the end:

Making all in .
make[3]: Entering directory `/home/nitrous/gnupg-new/tests'
srcdir=. GNUPGHOME=`/bin/pwd` GPG_AGENT_INFO= LC_ALL=C GPGSM=../sm/gpgsm ./runtest ./inittests
/bin/bash: ./runtest: Permission denied
make[3]: *** [inittests.stamp] Error 126
make[3]: Leaving directory `/home/nitrous/gnupg-new/tests'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/nitrous/gnupg-new/tests'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/nitrous/gnupg-new'
make: *** [all] Error 2

Edit 3:

I ran a sudo chmod 755 on tests/runtest and did ./configure and sudo make AGAIN and now I have this error:

Making all in .
make[3]: Entering directory `/home/nitrous/gnupg-new/tests'
srcdir=. GNUPGHOME=`/bin/pwd` GPG_AGENT_INFO= LC_ALL=C GPGSM=../sm/gpgsm ./runtest ./inittests
asschk: interpreter: invalid statement `set'
make[3]: *** [inittests.stamp] Error 1
make[3]: Leaving directory `/home/nitrous/gnupg-new/tests'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/nitrous/gnupg-new/tests'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/nitrous/gnupg-new'
make: *** [all] Error 2

Sigh....

  • You'll probably also have to compile and install libgpg-error and libgcrypt. Though I'm surprised you had to do chmod 775 configure - the tarball should already have an executable configure. – muru Oct 3 '15 at 8:18
  • @muru I have done that and edited my original post with the results. – Joshua Terrill Oct 3 '15 at 8:30
  • @muru fwiw it appears to configure and build successfully on my 64-bit 14.04 box with the standard repo versions of libgcrypt20-dev and libgpg-error-dev - I didn't need to install any newer dependencies from source. – steeldriver Oct 3 '15 at 11:36
up vote 5 down vote accepted

I have found the provided speedo method the easiest for gnupg-2.1.X:

  1. sudo apt-get update

  2. sudo apt-get install libldap2-dev gtk+-2 libbz2-dev

  3. after unpacking the latest gnupg-2.1.X tarball and cd to the new folder, run the command:

    sudo make -f build-aux/speedo.mk native INSTALL_PREFIX=/usr/local
    
  4. sudo ldconfig

  5. download the latest pinentry-0.9.5, run ./configure && make && sudo make install.

  6. test it out: gpg2 --version

****I would like to update this answer for GnuPG v2.2.x. The following bash file will install on Ubuntu 16.04, 17.10:

cd ~/Downloads
version=gnupg-2.2.2
wget https://gnupg.org/ftp/gcrypt/gnupg/$version.tar.bz2
wget https://gnupg.org/ftp/gcrypt/gnupg/$version.tar.bz2.sig
tar xf $version.tar.bz2
cd $version
sudo apt-get update
sudo apt-get install -y libldap2-dev
sudo apt-get install -y gtk+-2
sudo apt-get install -y rng-tools
sudo apt-get install -y libbz2-dev
sudo apt-get install -y zlib1g-dev
sudo apt-get install -y libgmp-dev
sudo apt-get install -y nettle-dev
sudo apt-get install -y libgnutls28-dev
sudo apt-get install -y libsqlite3-dev
sudo apt-get install -y adns-tools
sudo apt-get install -y libreadline-dev
sudo apt-get install -y pinentry-gtk2
sudo apt-get install -y pcscd scdaemon
sudo make -f build-aux/speedo.mk native INSTALL_PREFIX=/usr/local
sudo ldconfig

This will support TOFU and Smart Cards like Yubikey 4 Nano. To update to the newest version edit version=gnupg-2.2.2 Test it: gpg --version

  • What do you mean download pinentry? Do I run those commands in pinentry to install it? Or do I install pinentry and then run those commands in gnupg? What does pinentry do? – Joshua Terrill Oct 3 '15 at 23:40
  • Nevermind, I got it. I was typing in gpg instead of gpg2 (idiot). Thanks! – Joshua Terrill Oct 3 '15 at 23:45
  • To be complete - yes download pinentry tarball, unpack, cd to new directory, and run ./configure etc to install it. Pinentry is not necessary to compile GnuPG but it is needed to enter passphrases interactively. – mac333 Oct 4 '15 at 12:36

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.