Skip to content

Instantly share code, notes, and snippets.

@shrutikaponde
Forked from mattrude/GnuPG-2.1.md
Last active November 11, 2020 18:03
Show Gist options
  • Save shrutikaponde/25a4da010c9a8d2faf5edceacd1b07e1 to your computer and use it in GitHub Desktop.
Save shrutikaponde/25a4da010c9a8d2faf5edceacd1b07e1 to your computer and use it in GitHub Desktop.
GnuPG 2.2.23 Build Instructions for Ubuntu 16.04 LTS

GnuPG 2.2.23 Build Instructions

Build instructions for GnuPG 2.2.23. These instructions are built for a headless Ubuntu 16.04 LTS server.

Or if you wish, you may use the install script to install GnuPG 2.2.23 by entring the following:

curl -sL "https://gist.github.com/shrutikaponde/25a4da010c9a8d2faf5edceacd1b07e1/raw/install-gnupg2.sh" |sh

Install the needed depends

sudo apt-get -y install libgnutls-dev bzip2 make gettext texinfo gnutls-bin \
build-essential g++

Setup the build

mkdir -p /var/src/gnupg22 && cd /var/src/gnupg22
gpg --list-keys
gpg --keyserver keyserver.ubuntu.com --recv-keys 0x4F25E3B6 0xE0856959 0x33BD3F06 0x7EFD60D9 0xF7E48EDB

Installing libgpg-error 1.27

wget -c ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.27.tar.gz && \
wget -c ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.27.tar.gz.sig && \
gpg --verify libgpg-error-1.27.tar.gz.sig && tar -xzf libgpg-error-1.27.tar.gz && \
cd libgpg-error-1.27/ && ./configure && make && sudo make install && cd ../

Installing libgcrypt 1.7.6

wget -c ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.7.6.tar.gz && \
wget -c ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.7.6.tar.gz.sig && \
gpg --verify libgcrypt-1.7.6.tar.gz.sig && tar -xzf libgcrypt-1.7.6.tar.gz && \
cd libgcrypt-1.7.6 && ./configure && make && sudo make install && cd ../

Installing libassuan 2.5.1

wget -c ftp://ftp.gnupg.org/gcrypt/libassuan/libassuan-2.5.1.tar.bz2 && \
wget -c ftp://ftp.gnupg.org/gcrypt/libassuan/libassuan-2.5.1.tar.bz2.sig && \
gpg --verify libassuan-2.5.1.tar.bz2.sig && tar -xjf libassuan-2.5.1.tar.bz2 && \
cd libassuan-2.5.1 && ./configure && make && sudo make install && cd ../

Installing libksba 1.3.5

wget -c  ftp://ftp.gnupg.org/gcrypt/libksba/libksba-1.3.5.tar.bz2 && \
wget -c ftp://ftp.gnupg.org/gcrypt/libksba/libksba-1.3.5.tar.bz2.sig && \
gpg --verify libksba-1.3.5.tar.bz2.sig && tar -xjf libksba-1.3.5.tar.bz2 && \
cd libksba-1.3.5 && ./configure && make && sudo make install && cd ../

Installing npth 1.3

wget -c ftp://ftp.gnupg.org/gcrypt/npth/npth-1.3.tar.bz2 && \
wget -c ftp://ftp.gnupg.org/gcrypt/npth/npth-1.3.tar.bz2.sig && \
gpg --verify npth-1.3.tar.bz2.sig && tar -xjf npth-1.3.tar.bz2 && \
cd npth-1.3 && ./configure && make && sudo make install && cd ../

Install GnuPG 2.2.23

wget -c ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-2.2.23.tar.bz2 && \
wget -c ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-2.2.23.tar.bz2.sig && \
gpg --verify gnupg-2.2.23.tar.bz2.sig && tar -xjf gnupg-2.2.23.tar.bz2 && \
cd gnupg-2.2.23 && ./configure && make && sudo make install && echo $?

Finishing the build

echo "/usr/local/lib" > sudo /etc/ld.so.conf.d/gpg2.conf && ldconfig -v
#!/bin/bash
sudo apt-get update
sudo apt-get -y install libgnutls-dev bzip2 make gettext texinfo gnutls-bin build-essential g++
mkdir -p /var/src/gnupg22 && cd /var/src/gnupg22
gpg --list-keys
gpg --keyserver keyserver.ubuntu.com --recv-keys 0x4F25E3B6 0xE0856959 0x33BD3F06 0x7EFD60D9 0xF7E48EDB
wget -c ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.27.tar.gz && \
wget -c ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.27.tar.gz.sig && \
wget -c ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.7.6.tar.gz && \
wget -c ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.7.6.tar.gz.sig && \
wget -c ftp://ftp.gnupg.org/gcrypt/libassuan/libassuan-2.5.1.tar.bz2 && \
wget -c ftp://ftp.gnupg.org/gcrypt/libassuan/libassuan-2.5.1.tar.bz2.sig && \
wget -c ftp://ftp.gnupg.org/gcrypt/libksba/libksba-1.3.5.tar.bz2 && \
wget -c ftp://ftp.gnupg.org/gcrypt/libksba/libksba-1.3.5.tar.bz2.sig && \
wget -c ftp://ftp.gnupg.org/gcrypt/npth/npth-1.2.tar.bz2 && \
wget -c ftp://ftp.gnupg.org/gcrypt/npth/npth-1.2.tar.bz2.sig && \
wget -c ftp://ftp.gnu.org/gnu/ncurses/ncurses-6.0.tar.gz && \
wget -c ftp://ftp.gnu.org/gnu/ncurses/ncurses-6.0.tar.gz.sig && \
wget -c ftp://ftp.gnupg.org/gcrypt/pinentry/pinentry-0.9.5.tar.bz2 && \
wget -c ftp://ftp.gnupg.org/gcrypt/pinentry/pinentry-0.9.5.tar.bz2.sig && \
wget -c ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-2.2.23.tar.bz2 && \
wget -c ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-2.2.23.tar.bz2.sig && \
gpg --verify libgpg-error-1.27.tar.gz.sig && tar -xzf libgpg-error-1.27.tar.gz && \
gpg --verify libgcrypt-1.7.6.tar.gz.sig && tar -xzf libgcrypt-1.7.6.tar.gz && \
gpg --verify libassuan-2.5.1.tar.bz2.sig && tar -xjf libassuan-2.5.1.tar.bz2 && \
gpg --verify libksba-1.3.5.tar.bz2.sig && tar -xjf libksba-1.3.5.tar.bz2 && \
gpg --verify npth-1.2.tar.bz2.sig && tar -xjf npth-1.2.tar.bz2 && \
gpg --verify gnupg-2.2.23.tar.bz2.sig && tar -xjf gnupg-2.2.23.tar.bz2 && \
cd libgpg-error-1.27/ && ./configure && make && sudo make install && cd ../ && \
cd libgcrypt-1.7.6 && ./configure && make && sudo make install && cd ../ && \
cd libassuan-2.5.1 && ./configure && make && sudo make install && cd ../ && \
cd libksba-1.3.5 && ./configure && make && sudo make install && cd ../ && \
cd npth-1.2 && ./configure && make && sudo make install && cd ../ && \
make && sudo make install && cd ../ && \
cd gnupg-2.2.23 && ./configure && make && sudo make install && \
echo "/usr/local/lib" > /etc/ld.so.conf.d/gpg2.conf && ldconfig -v && \
echo "Complete!!!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment