Install ag (the silver searcher) [on CentOS / Ubuntu / Mac]

Reason for writing this article: shinto_shrine:

The command that can search the contents of a file is "grep", but some people are migrating with the appearance of "grab", "ack", "ag", etc. that speed up the grep.

This time, ** ag ** of rumored to be particularly early among them [^ 1] is posted on GitHub document on CentOS8 virtually built with VirtualBox / Vagrant. I tried to install it with the following command. However...

--The result is the same with yum
$ sudo dnf update
$ sudo dnf install the_silver_searcher
--I get the following error and cannot install
Failed to set locale, defaulting to C.UTF-8
Last metadata expiration check: 0:04:22 ago on Wed Nov 18 17:23:56 2020.
No match for argument: the_silver_searcher
Error: Unable to find a match: the_silver_searcher

However, as mentioned above, I got an error and could not install it, so I will explain how to do it well. By the way, I will do the same for Mac and Ubuntu.

Installed on various OS: champagne:

CentOS8 --Version confirmation

$ cat /etc/redhat-release
CentOS Linux release 8.0.1905 (Core)

--Installation

-- README.There are the following two descriptions in md dependencies
$ sudo dnf -y groupinstall "Development Tools"
$ sudo dnf -y install pcre-devel xz-devel zlib-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
--Make sure it contains ag
$ which ag
/usr/local/bin/ag

Ubuntu --Version confirmation

$ cat /etc/os-release
--Partially omitted
VERSION="20.04.1 LTS (Focal Fossa)"

--Installation

$ apt update
$ sudo apt install silversearcher-ag
--Make sure it contains ag
$ which ag
/usr/bin/ag

MacOS --Version confirmation

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.15.7
BuildVersion:   19H15

--Installation

$ sudo brew install the_silver_searcher
--Make sure it contains ag
$ which ag
/usr/local/bin/ag

In the future, I plan to find time to write a light article on how to use ag and how to compare it with grep. : rocket: That's all for today.

Reference article: blue_book:

[^ 1]: It is overwhelmingly faster as the author's sense value 3 to 5 times faster than ack, which is faster than grep There is also information that. However, there is also a dissenter, and the author has not verified it numerically, so I cannot make a statement here. sorry.

Recommended Posts

Install ag (the silver searcher) [on CentOS / Ubuntu / Mac]
Install OpenJDK (Java) on the latest Ubuntu
Install the webmail client Rainloop on CentOS 8
Install the latest version of Jenkins on Ubuntu 16
Install gradle on mac
Install Java on Mac
Install pyqt5 on ubuntu
Install Neo4j 4.1.3 on centOS
Install Vertica 10.0 on CentOS 6.10
Install Ruby on Ubuntu 20.04
Install PostgreSQL 12 on Centos8
Install nginx on centOS7
Install Python 3 on CentOS 7
Install kuromoji on CentOS7
Install Autoware on Ubuntu 18.04.5
Install Mattermost on CentOS 7
Install jpndistrict on CentOS 7
Install openjdk11 on mac
Install Homebrew on Ubuntu 20.04
Install Redmine 4.1.1 on CentOS 7
Install OpenJDK 8 on mac
Smokeping Install on CentOS7
Install PostgreSQL 13 on CentOS 7.5
Install MySQL 5.6 on CentOS6 [How to specify the version]
Install OpenJDK7 (JAVA) on ubuntu 14.04
Install Cybozu Office 10 on Ubuntu 20.4
Install Docker on Ubuntu Server 20.04
Install MAV Proxy on Ubuntu 18.04
Install OpenFOAM v2006 on CentOS
Install Arudino IDE on Ubuntu 20
Install Java on WSL Ubuntu 18.04
Install Jenkins on Docker's CentOS
Install Ubuntu Desktop 20.10 on RaspberryPi4
Install Apache on CentOS on VirtualBox
Install Arduino IDE on Ubuntu 20.04
Install raspi-config on Ubuntu 20.04 (LTS)
Install WordPress 5.5 on Ubuntu 20.04 LTS
Install Ruby 2.7 on CentOS 7 (SCL)
Install PlantUML on Intellij on Ubuntu
Install tomcat + eclipse on mac
Install Ubuntu Server 20.04 on Btrfs
Note: Install PostgreSQL 9.5 on Ubuntu 18.04
Try DPDK20 SDK on CentOS7 â‘ Install
Install AWS IoT Greengrass on Ubuntu
Install JDK and JRE on Ubuntu 16.10
Install ngrok on ubuntu16.04 using Vagrant
Build the latest Samba 4 on Ubuntu 20.04
Install Ruby 2.5 on CentOS 7 using SCL
Install the project management tool "Redmine" on CentOS8 (database is Postgre)
Install Java Open JDK 8 on CentOS 7
How to install and configure the monitoring tool "Graphite" on Ubuntu
How to install MariaDB 10.4 on CentOS 8
Install apache 2.4.46 from source on CentOS7
Steps to install MySQL 8 on CentOS 8
How to install WildFly on Ubuntu 18.04
Install MQTT broker Mosquitto on Ubuntu 18.04
Install SonarQube on ECS instance on Ubuntu 16.04
Install Ubuntu20.04 on RaspberryPi 4 and build Kubernetes to run the container
Steps to install devtoolset-6 on CentOS 7
Install ruby on Ubuntu 20.04 with rbenv
Install Java 9 on windows 10 and CentOS 7