Installing Ripgrep on Mac, CentOS and Debian

Installing ripgrep

* This page contains promotional content

Notes from installing Ripgrep(rg), which searches faster than grep, ack and silver_searcher, on several platforms

Mac

Install it straight from homebrew (if homebrew is already installed)

$ brew install ripgrep

CentOS 7

On CentOS, ripgrep is not in the standard repositories or in epel, so install it as follows

$ sudo yum-config-manager --add-repo=https://copr.fedorainfracloud.org/coprs/carlwgeorge/ripgrep/repo/epel-7/carlwgeorge-ripgrep-epel-7.repo
$ sudo yum install ripgrep

Debian 10

# apt install ripgrep

If your version of Debian9 or Ubuntu is old and the package is not in apt, use the following

$ curl -LO https://github.com/BurntSushi/ripgrep/releases/download/0.8.1/ripgrep_0.8.1_amd64.deb
$ sudo dpkg -i ripgrep_0.8.1_amd64.deb

Manual installation

If you cannot find a package for your OS, or you deliberately avoid packages and build from source, the method below works on most platforms

$ git clone https://github.com/BurntSushi/ripgrep
$ cd ripgrep
$ cargo build --release
$ ./target/release/rg --version
0.1.3

Other platforms

I cannot try FreeBSD, OpenSUSE, Windows, Gentoo and so on in my environment, so please refer to the article below

Docs.rs