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

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

On Debian possible default full paths are:

/usr/bin/lastcomm - from package: acct

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