ppmtopgm: 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/ppmtopgm - from package: netpbm-progs

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

On Debian possible default full paths are:

/usr/bin/ppmtopgm - from package: netpbm

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