astgenkey: 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/sbin/astgenkey - from package: asterisk

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

On Debian possible default full paths are:

/usr/sbin/astgenkey - from package: asterisk

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