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

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

On Debian possible default full paths are:

/usr/bin/pnmtosgi - from package: netpbm

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