bg5+pdflatex: 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/bg5+pdflatex - from package: texlive-east-asian

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

On Debian possible default full paths are:

/usr/bin/bg5+pdflatex - from package: latex-cjk-chinese

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