ghc-pkg: 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/ghc-pkg - from package: ghc-compiler

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

On Debian possible default full paths are:

/usr/bin/ghc-pkg - from package: ghc
/usr/lib/ghc/bin/ghc-pkg - from package: ghc

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