gpg2: command not found

Have You tried accessing the binary with the full path?

Maybe Your $PATH variable doesn't contain the default paths? echo $PATH should give something like:

[root@server ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

If it's empty, You may set the PATH variable with this command

export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"

On CentOS possible default full paths are:

/usr/bin/gpg2 - from package: gnupg2

You may install the required package with command yum install {package}

On Debian possible default full paths are:

/usr/bin/gpg2 - from package: gnupg2

You may install the required package with command apt-get install {package}
Error in other languages:
gpg2: bevel nie gevind nie
gpg2: comandă negăsită
gpg2: comando não encontrado
gpg2: commande introuvable
gpg2: command not found
gpg2: käsku ei ole
gpg2: không tìm thấy lệnh
gpg2: komanda nerasta
gpg2: Kommando nicht gefunden.
gpg2: kommandot finns inte
gpg2: komut yok
gpg2: nie znaleziono polecenia
gpg2: níor aimsíodh an t-ordú
gpg2: no se encontró la orden
gpg2: no s'ha trobat l'ordre
gpg2: opdracht niet gevonden
gpg2: parancs nem található
gpg2: perintah tidak ditemukan
gpg2: príkaz nenájdený
gpg2: příkaz nenalezen
gpg2: команда не найдена
gpg2: командата не е открита
gpg2: 命令找不到
gpg2: コマンドが見つかりません