mkinstalldirs: 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/lib64/R/bin/mkinstalldirs - from package: R-core
/usr/lib/R/bin/mkinstalldirs - from package: R-core

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

On Debian possible default full paths are:

/usr/lib/R/bin/mkinstalldirs - from package: r-base-core

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