Installing Ripgrep
ripgrep is distributed as a single static binary with no runtime dependencies. Installation is fast on all major platforms.
Ubuntu / Debian
sudo apt update
sudo apt install ripgrep
Verify:
rg --version
# ripgrep 14.x.x
macOS (Homebrew)
brew install ripgrep
Alpine Linux / Docker
On Alpine the package is named ripgrep:
apk add ripgrep
One-liner for Dockerfiles:
RUN apk add --no-cache ripgrep
Via Cargo (All Platforms)
If you have the Rust toolchain installed, this always gives you the latest version with full PCRE2 support compiled in:
cargo install ripgrep
PCRE2 requires the pcre2 system library. To compile with PCRE2:
cargo install ripgrep --features pcre2
Pre-built Binaries
GitHub Releases provide pre-compiled binaries for Linux (musl), macOS, and Windows:
# Example: install to /usr/local/bin without apt/cargo
VERSION="14.1.1"
curl -LO "https://github.com/BurntSushi/ripgrep/releases/download/${VERSION}/ripgrep-${VERSION}-x86_64-unknown-linux-musl.tar.gz"
tar -xzf ripgrep-*.tar.gz
sudo mv ripgrep-*/rg /usr/local/bin/
rg --version
Confirming Full Feature Support
Some distributions ship rg without PCRE2 support (which enables lookaheads via -P). Check with:
rg --pcre2-version
# PCRE2 10.43 is available
# (or "PCRE2 is not available" if compiled without it)