dirname: 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/dirname - from package: coreutils

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

On Debian possible default full paths are:

/usr/bin/dirname - from package: coreutils

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