xmode2: 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/xmode2 - from package: lirc

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

On Debian possible default full paths are:

/usr/bin/xmode2 - from package: lirc-x

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