ag: 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/ag - from package: the_silver_searcher

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

On Debian possible default full paths are:

/usr/bin/ag - from package: silversearcher-ag

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