Below are my build instructions for GnuPG 2.2.10, released on August 30th, 2018. These instructions are built for a headless Ubuntu 18.04 LTS server (and have also been tested on Ubuntu 14.04/16.04).
If you prefer, you may use the below install script to install GnuPG 2.2.x by running the following commands:
curl -OL "https://gist.githubusercontent.com/JohnnyFang/ca2f243a9adb179186e5932c9c1445d0/raw/a2d4ca7056f9908d0f856acff7d2b466a99306ff/install-gnupg22.sh" && sudo -H bash ./install-gnupg22.sh