Below are my build/compile instructions for GnuPG 2.2.27, released on Monday, January 11, 2021. These instructions were tested on a working Kubuntu 20.10 "The Groovy Gorilla" desktop environment but should be applicable to all Debian-derivative GNU/Linux distributions since Ubuntu 18.04 LTS "Bionic Beaver." (Go Beavers!)
If you prefer, you may use the install script below to automate the process and install GnuPG 2.2.27 with the following command on your computer's terminal:
curl -L https://mello.link/gnupg2227 | sudo -H bash
NOTE: This guide builds in /var/src and installs to /usr/local, both of which require root permissions to write in
You can either prefix the commands below with sudo as you go, or open a root shell with sudo -H -s
and run the commands as shown, issuing the exit
command when done to drop the root privileges and return to your user shell.
apt install -y bzip2 wget2 make gettext texinfo doxygen gnutls-bin encfs fuse3 build-essential libbz2-dev zlib1g-dev libncurses5-dev libsqlite3-dev libldap2-dev libsecret-1-dev libgcr-3-dev libfltk1.3-dev libusb-1.0-0-dev policykit-1
rm -rf /var/src/gnupg*
Setup the build folder and configuration shell, print all keys from your gpg user keyring to stdout in case of catastrophe, and retrieve the GnuPG release signing keys
mkdir -p /var/src/gnupg2 && cd /var/src/gnupg2
typeset -gx CONFIG_SHELL="$(command -v bash)"
gpg --list-keys
gpg --keyserver keyserver.ubuntu.com --recv-keys 04376F3EE0856959 2071B08A33BD3F06 8A861B1C7EFD60D9 528897B826403ADA A8DC7067E25FBABB
wget2 -c https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.41.tar.bz2
wget2 -c https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.41.tar.bz2.sig
gpg --verify libgpg-error-1.41.tar.bz2.sig && tar xjof libgpg-error-1.41.tar.bz2
cd libgpg-error-1.41
autoreconf -fi && ./configure --sysconfdir=/etc --sharedstatedir=/var/lib --localstatedir=/var/local --runstatedir=/run \
--libdir=/usr/local/lib/x86_64-linux-gnu --enable-threads=posix --disable-rpath && make -j$(nproc)
make check -j$(nproc) && make install
cd ..
wget2 -c https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.9.2.tar.bz2
wget2 -c https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.9.2.tar.bz2.sig
gpg --verify libgcrypt-1.9.2.tar.bz2.sig && tar xjof libgcrypt-1.9.2.tar.bz2
cd libgcrypt-1.9.2
autoreconf -fi && ./configure --sysconfdir=/etc --sharedstatedir=/var/lib --localstatedir=/var/local --runstatedir=/run \
--libdir=/usr/local/lib/x86_64-linux-gnu --enable-m-guard --enable-hmac-binary-check --with-capabilities && make -j$(nproc)
make check -j$(nproc) && make install
cd ..
wget2 -c https://gnupg.org/ftp/gcrypt/libksba/libksba-1.5.0.tar.bz2
wget2 -c https://gnupg.org/ftp/gcrypt/libksba/libksba-1.5.0.tar.bz2.sig
gpg --verify libksba-1.5.0.tar.bz2.sig && tar xjof libksba-1.5.0.tar.bz2
cd libksba-1.5.0
autoreconf -fi && ./configure --sysconfdir=/etc --sharedstatedir=/var/lib --localstatedir=/var/local --runstatedir=/run \
--libdir=/usr/local/lib/x86_64-linux-gnu && make -j$(nproc)
make check && make install
cd ..
wget2 -c https://gnupg.org/ftp/gcrypt/libassuan/libassuan-2.5.4.tar.bz2
wget2 -c https://gnupg.org/ftp/gcrypt/libassuan/libassuan-2.5.4.tar.bz2.sig
gpg --verify libassuan-2.5.4.tar.bz2.sig && tar xjof libassuan-2.5.4.tar.bz2
cd libassuan-2.5.4
autoreconf -fi && ./configure --sysconfdir=/etc --sharedstatedir=/var/lib --localstatedir=/var/local --runstatedir=/run \
--libdir=/usr/local/lib/x86_64-linux-gnu && make -j$(nproc)
make check -j$(nproc) && make install
cd ..
wget2 -c https://gnupg.org/ftp/gcrypt/ntbtls/ntbtls-0.2.0.tar.bz2
wget2 -c https://gnupg.org/ftp/gcrypt/ntbtls/ntbtls-0.2.0.tar.bz2.sig
gpg --verify ntbtls-0.2.0.tar.bz2.sig && tar xjof ntbtls-0.2.0.tar.bz2
cd ntbtls-0.2.0
autoreconf -fi && ./configure --sysconfdir=/etc --sharedstatedir=/var/lib --localstatedir=/var/local --runstatedir=/run \
--libdir=/usr/local/lib/x86_64-linux-gnu && make -j$(nproc) && make install
cd ..
wget2 -c https://gnupg.org/ftp/gcrypt/npth/npth-1.6.tar.bz2
wget2 -c https://gnupg.org/ftp/gcrypt/npth/npth-1.6.tar.bz2.sig
gpg --verify npth-1.6.tar.bz2.sig && tar xjof npth-1.6.tar.bz2
cd npth-1.6
autoreconf -fi && ./configure --sysconfdir=/etc --sharedstatedir=/var/lib --localstatedir=/var/local \
--runstatedir=/run --libdir=/usr/local/lib/x86_64-linux-gnu && make -j$(nproc)
make check -j$(nproc) && make install
cd ..
wget2 -c https://gnupg.org/ftp/gcrypt/pinentry/pinentry-1.1.1.tar.bz2
wget2 -c https://gnupg.org/ftp/gcrypt/pinentry/pinentry-1.1.1.tar.bz2.sig
gpg --verify pinentry-1.1.1.tar.bz2.sig && tar xjof pinentry-1.1.1.tar.bz2
cd pinentry-1.1.1
autoreconf -fi && ./configure --sysconfdir=/etc --sharedstatedir=/var/lib --localstatedir=/var/local --runstatedir=/run \
--libdir=/usr/local/lib/x86_64-linux-gnu --enable-pinentry-curses --enable-fallback-curses --enable-pinentry-tty \
--disable-rpath --enable-libsecret --disable-pinentry-gtk2 --enable-pinentry-gnome3 --enable-pinentry-fltk \
--enable-pinentry-qt && make -j$(nproc) && make install
cd ..
wget2 -c https://gnupg.org/ftp/gcrypt/gpgme/gpgme-1.15.1.tar.bz2
wget2 -c https://gnupg.org/ftp/gcrypt/gpgme/gpgme-1.15.1.tar.bz2.sig
gpg --verify gpgme-1.15.1.tar.bz2.sig && tar xjof gpgme-1.15.1.tar.bz2
cd gpgme-1.15.1
autoreconf -fi && ./configure --sysconfdir=/etc --sharedstatedir=/var/lib --localstatedir=/var/local --runstatedir=/run \
--libdir=/usr/local/lib/x86_64-linux-gnu && make -j$(nproc)
make check -j$(nproc) && make install
cd ..
wget2 -c https://gnupg.org/ftp/gcrypt/gpa/gpa-0.10.0.tar.bz2
wget2 -c https://gnupg.org/ftp/gcrypt/gpa/gpa-0.10.0.tar.bz2.sig
gpg --verify gpa-0.10.0.tar.bz2.sig && tar xjof gpa-0.10.0.tar.bz2
cd gpa-0.10.0
autoreconf -fi && ./configure --sysconfdir=/etc --sharedstatedir=/var/lib --localstatedir=/var/local --runstatedir=/run \
--libdir=/usr/local/lib/x86_64-linux-gnu --disable-rpath && make -j$(nproc) && make install
cd ..
wget2 -c https://gnupg.org/ftp/gcrypt/gnupg/gnupg-2.2.27.tar.bz2
wget2 -c https://gnupg.org/ftp/gcrypt/gnupg/gnupg-2.2.27.tar.bz2.sig
gpg --verify gnupg-2.2.27.tar.bz2.sig && tar xjof gnupg-2.2.27.tar.bz2
cd gnupg-2.2.27
autoreconf -fi && ./configure --sysconfdir=/etc --sharedstatedir=/var/lib --localstatedir=/var/local --runstatedir=/run \
--libdir=/usr/local/lib/x86_64-linux-gnu --enable-g13 --enable-large-secmem --disable-rpath \
--enable-run-gnupg-user-socket --with-capabilities && make -j$(nproc)
make check -j$(nproc) && make install
ldconfig
Congratulations, you're done. Live long and encrypt.
I'm getting this error.
line 37: export: `/bin/bash': not a valid identifier