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

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