Skip to content

Instantly share code, notes, and snippets.

@zipizap
Forked from vt0r/GnuPG-2.2.md
Last active December 1, 2016 21:44
Show Gist options
  • Save zipizap/3c0bdf4f271ff12b63acd0a729f1d67e to your computer and use it in GitHub Desktop.
Save zipizap/3c0bdf4f271ff12b63acd0a729f1d67e to your computer and use it in GitHub Desktop.
Build/install instructions for GnuPG 2.1.x on Ubuntu and similar distros
#!/bin/bash
# Script to automatically download + compile + install GnuPG 2.1.15
# 2016/08/24 - Updated script and tested with Debian 8.5 Jessie
set -x
apt-get update
apt-get -y install build-essential libgnutls-dev bzip2 make gettext texinfo gnutls-bin libgnutls28-dev build-essential libbz2-dev zlib1g-dev libncurses5-dev
mkdir -p /var/src/gnupg21 && cd /var/src/gnupg21
# Install the keys manually
# Read section "Release Signing Keys" of https://lists.gnupg.org/pipermail/gnupg-announce/2014q4/000358.html
# which will point to https://gnupg.org/signature_key.html where you will find the public key block used bellow,
# containing all the required keys
gpg --import <<EOT
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQENBE0ti4EBCACqGtKlX9jI/enhlBdy2cyQP6Q7JoyxtaG6/ckAKWHYrqFTQk3I
Ue8TuDrGT742XFncG9PoMBfJDUNltIPgKFn8E9tYQqAOlpSA25bOb30cA2ADkrjg
jvDAH8cZ+fkIayWtObTxwqLfPivjFxEM//IdShFFVQj+QHmXYBJggWyEIil8Bje7
KRw6B5ucs4qSzp5VH4CqDr9PDnLD8lBGHk0x8jpwh4V/yEODJKATY0Vj00793L8u
qA35ZiyczUvvJSLYvf7STO943GswkxdAfqxXbYifiK2gjE/7SAmB+2jFxsonUDOB
1BAY5s3FKqrkaxZr3BBjeuGGoCuiSX/cXRIhABEBAAG0Fldlcm5lciBLb2NoIChk
aXN0IHNpZymJAT4EEwECACgFAk0ti4ECGwMFCRDdnwIGCwkIBwMCBhUIAgkKCwQW
AgMBAh4BAheAAAoJECSbOdJPJeO2PlMIAJxPtFXf5yozPpFjRbSkSdjsk9eru05s
hKZ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BL
b2NoIChnbnVwZyBzaWcpIDxkZDlqbkBnbnUub3JnPohhBBMRAgAhAheABQkOFIf9
BQJBvGheBgsJCAcDAgMVAgMDFgIBAh4BAAoJEGi3q4lXVI3NBJMAn01313ag0tgj
rGUZtDlKYbmNIeMeAJ0UpVsjxpylBcSjsPE8MAki7Hb2Rw==
=W3eM
-----END PGP PUBLIC KEY BLOCK-----
EOT
wget -c https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.24.tar.gz && \
wget -c https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.24.tar.gz.sig && \
wget -c https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.7.3.tar.gz && \
wget -c https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.7.3.tar.gz.sig && \
wget -c https://www.gnupg.org/ftp/gcrypt/libassuan/libassuan-2.4.3.tar.bz2 && \
wget -c https://www.gnupg.org/ftp/gcrypt/libassuan/libassuan-2.4.3.tar.bz2.sig && \
wget -c https://www.gnupg.org/ftp/gcrypt/libksba/libksba-1.3.4.tar.bz2 && \
wget -c https://www.gnupg.org/ftp/gcrypt/libksba/libksba-1.3.4.tar.bz2.sig && \
wget -c https://www.gnupg.org/ftp/gcrypt/npth/npth-1.2.tar.bz2 && \
wget -c https://www.gnupg.org/ftp/gcrypt/npth/npth-1.2.tar.bz2.sig && \
wget -c https://www.gnupg.org/ftp/gcrypt/pinentry/pinentry-0.9.7.tar.bz2 && \
wget -c https://www.gnupg.org/ftp/gcrypt/pinentry/pinentry-0.9.7.tar.bz2.sig && \
wget -c https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-2.1.15.tar.bz2 && \
wget -c https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-2.1.15.tar.bz2.sig && \
gpg --verify libgpg-error-1.24.tar.gz.sig && tar -xzf libgpg-error-1.24.tar.gz && \
gpg --verify libgcrypt-1.7.3.tar.gz.sig && tar -xzf libgcrypt-1.7.3.tar.gz && \
gpg --verify libassuan-2.4.3.tar.bz2.sig && tar -xjf libassuan-2.4.3.tar.bz2 && \
gpg --verify libksba-1.3.4.tar.bz2.sig && tar -xjf libksba-1.3.4.tar.bz2 && \
gpg --verify npth-1.2.tar.bz2.sig && tar -xjf npth-1.2.tar.bz2 && \
gpg --verify pinentry-0.9.7.tar.bz2.sig && tar -xjf pinentry-0.9.7.tar.bz2 && \
gpg --verify gnupg-2.1.15.tar.bz2.sig && tar -xjf gnupg-2.1.15.tar.bz2 && \
cd libgpg-error-1.24/ && ./configure && make && make install && cd ../ && \
cd libgcrypt-1.7.3 && ./configure && make && make install && cd ../ && \
cd libassuan-2.4.3 && ./configure && make && make install && cd ../ && \
cd libksba-1.3.4 && ./configure && make && make install && cd ../ && \
cd npth-1.2 && ./configure && make && make install && cd ../ && \
cd pinentry-0.9.7 && ./configure --enable-pinentry-curses --disable-pinentry-qt4 && \
make && make install && cd ../ && \
cd gnupg-2.1.15 && ./configure && make && make install && \
echo "/usr/local/lib" > /etc/ld.so.conf.d/gpg2.conf && ldconfig -v && \
echo -e "\n\nComplete!!!\nBinaries placed in /usr/local/bin \nType gpg2 --version to check for yourself :)"
@NoSubstitute
Copy link

2.1.16 released a little over a week ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment