pwgen: 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/pwgen - from package: pwgen

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

On Debian possible default full paths are:

/usr/bin/pwgen - from package: pwgen

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