locale-gen: 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/locale-gen - from package: locales

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