pnmtopgm: 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 Debian possible default full paths are:

/usr/bin/pnmtopgm - from package: ivtools-bin

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