- libpcre
- liblzma
$ sudo yum install -y pcre-devel
$ sudo yum install xz-devel
$ cd /usr/local/src
$ sudo git clone https://github.com/ggreer/the_silver_searcher.git
$ cd the_silver_searcher
$ sudo ./build.sh
$ sudo make install
$ which ag
/usr/local/bin/ag
On CentOS 8, you can also build an RPM using the CentOS 7 SRPM. Something like the following worked for me.
curl -O https://download-ib01.fedoraproject.org/pub/epel/7/SRPMS/Packages/t/the_silver_searcher-2.1.0-1.el7.src.rpm yum install -y rpm-build xz-devel bash-completion rpmbuild --rebuild the_silver_searcher-2.1.0-1.el7.src.rpm sudo yum install $HOME/rpmbuild/RPMS/x86_64/the_silver_searcher-2.1.0-1.el8.x86_64.rpm