How to Install ripgrep on Debian: The Fastest Way to Search Your Code
ripgrep (the rg command) is a line-oriented search tool that recursively searches a directory for a regex pattern. It is written in Rust on top of the same regex engine that powers Rust’s standard tooling, and it has quietly become the default “find this string” tool for a very large number of developers.
What sets it apart is not only raw speed. ripgrep respects your .gitignore by default, skips hidden and binary files, understands file types, and prints results in a form that is easy to read and easy to pipe. It is the search backend behind editors like VS Code, Neovim’s Telescope, and Helix’s global search, so there is a good chance you already rely on it indirectly.
Debian does ship ripgrep in the archive, but archive versions freeze at release time and stay there for the life of the stable release. ripgrep keeps gaining performance work, new flags and better Unicode handling, and the archive build also links against system PCRE2.
The unofficial deb.griffo.io repository packages the upstream release as a proper .deb: a statically linked musl binary with PCRE2 compiled in, no shared library dependencies at runtime, and updates that arrive with the rest of your system.
Install the Latest ripgrep on Debian: The Short Version
If you only came for the commands, this adds the repository and installs the latest ripgrep .deb package on Debian:
sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://deb.griffo.io/EA0F721D231FDD3A0A17B9AC7808B4DD62C41256.asc | sudo gpg --dearmor --yes -o /etc/apt/keyrings/deb.griffo.io.gpg
echo "deb [signed-by=/etc/apt/keyrings/deb.griffo.io.gpg] https://deb.griffo.io/apt $(lsb_release -sc 2>/dev/null) main" | sudo tee /etc/apt/sources.list.d/deb.griffo.io.list > /dev/null
sudo apt update
sudo apt install ripgrep
The rest of this guide explains what each command does, how to verify the install, how to keep ripgrep up to date, and what to check when something goes wrong.
What Makes ripgrep Special?
- ⚡ Extremely fast - Parallel directory traversal, a finite automata based regex engine, and aggressive literal optimisations make it faster than grep and ack on most real workloads.
- 🙈 Smart filtering by default - Honours
.gitignore,.ignoreand.rgignore, skips hidden files and binaries, so results are signal rather than noise. - 🗂️ File type filters -
rg -tpy,rg -Trustand friends narrow a search to a language without writing glob patterns by hand. - 🌍 First-class Unicode - Correct handling of UTF-8, character classes and case folding without special flags.
- 🔎 PCRE2 when you need it -
-Punlocks look-around and backreferences, compiled into this build. - 🔁 Multiline and replace -
-Usearches across line boundaries,-rrewrites matches on the fly. - 🤖 Machine-readable output -
--jsonemits structured events for editors and scripts. - 📦 Single static binary - No runtime dependencies to install or keep in sync.
Why Use the deb.griffo.io Repository?
- A current ripgrep rather than whatever was frozen into the Debian release.
- Easy installation and updates through APT, no cargo build and no manual downloads.
- PCRE2 compiled in, so
-Pworks without pulling extra libraries. - Static musl build with no shared library dependencies at runtime.
- Works across supported Debian releases, with the codename detected automatically.
Prerequisites
Before you start, make sure you have:
- A Debian-based system (Bookworm 12, Trixie 13, Forky, or Sid)
sudoprivilegescurlinstalled (sudo apt install curlif needed)
Step 1: Add the deb.griffo.io Repository
Add the signing key and repository source:
# Create the keyrings directory
sudo install -d -m 0755 /etc/apt/keyrings
# Download and install the repository GPG key
curl -fsSL https://deb.griffo.io/EA0F721D231FDD3A0A17B9AC7808B4DD62C41256.asc | sudo gpg --dearmor --yes -o /etc/apt/keyrings/deb.griffo.io.gpg
# Add the repository (auto-detects your distro codename)
echo "deb [signed-by=/etc/apt/keyrings/deb.griffo.io.gpg] https://deb.griffo.io/apt $(lsb_release -sc 2>/dev/null) main" | sudo tee /etc/apt/sources.list.d/deb.griffo.io.list > /dev/null
# Update the package list
sudo apt update
What each command does:
- Create the keyrings directory - ensures
/etc/apt/keyringsexists with proper permissions. - Install the GPG key - downloads the repository key and de-armours it into a dedicated keyring for verification.
- Add the repository - writes a
signed-bysource line, withlsb_release -scsupplying your Debian codename. - Update the package list - refreshes APT so it knows about the new packages.
Step 2: Update the Package List
If you skipped the last line, run the update now:
sudo apt update
Step 3: Install ripgrep
Install ripgrep with APT:
sudo apt install ripgrep
Because deb.griffo.io carries a newer version than the Debian archive, APT prefers it automatically. If ripgrep was already installed from the archive, the same command upgrades it in place.
Step 4: Verify the Installation
The binary is rg. Confirm the version and which build you have:
rg --version
You should see output similar to:
ripgrep 15.2.0
features:+pcre2
The +pcre2 line is the one to look for: it means rg -P is available. Check which package supplied the binary with apt policy ripgrep, and read the full manual with man rg.
Getting Started with ripgrep
Everyday Searching
# Search the current directory tree for a pattern
rg "TODO"
# Case-insensitive search
rg -i "connectionstring"
# Smart case: case-insensitive unless the pattern has an uppercase letter
rg -S "Handler"
# Whole words only, with a fixed string rather than a regex
rg -w -F "user_id"
There is no -r . to remember: ripgrep recurses from the current directory by default and skips anything your .gitignore excludes.
Narrowing by File Type and Glob
# Only Python files
rg -tpy "def main"
# Everything except JSON
rg -Tjson "version"
# Glob patterns, including negation
rg "migrations" -g '*.cs' -g '!**/obj/**'
# List the types ripgrep knows about
rg --type-list
Context, Counts and File Lists
# Three lines of context around each match
rg -C3 "panic!"
# Just the file names that contain a match
rg -l "IDisposable"
# Count matches per file
rg -c "await "
# Files ripgrep would search, without searching them
rg --files
rg --files is a fast, gitignore-aware file lister, which makes it an excellent source for fzf:
rg --files | fzf
Searching What ripgrep Normally Skips
# Include hidden files
rg --hidden "api_key"
# Ignore .gitignore rules
rg --no-ignore "generated"
# Unrestricted: hidden files, ignored files and binaries
rg -uuu "magic-string"
Advanced Patterns
# Look-around and backreferences via PCRE2
rg -P '(?<=class )\w+' -tcs
# Multiline search across line boundaries
rg -U 'BEGIN;[\s\S]*?COMMIT;'
# Capture groups and replacement, printed not written
rg -r '$1' '"version":\s*"([^"]+)"'
# Structured output for tooling
rg --json "error" | head
Making It Yours
ripgrep reads default flags from a config file pointed at by RIPGREP_CONFIG_PATH:
# ~/.config/ripgrep/ripgreprc
--smart-case
--hidden
--glob=!.git/*
--max-columns=180
--max-columns-preview
# Add this to ~/.bashrc or ~/.zshrc
export RIPGREP_CONFIG_PATH="$HOME/.config/ripgrep/ripgreprc"
Shell Completions
The package installs completions for bash, zsh and fish out of the box, at /usr/share/bash-completion/completions/rg, /usr/share/zsh/vendor-completions/_rg and /usr/share/fish/vendor_completions.d/rg.fish. Start a new shell and rg --ty<TAB> will complete for you.
Keeping ripgrep Updated
Because ripgrep arrived via APT, updates come with the rest of the system:
sudo apt update && sudo apt upgrade
Whenever deb.griffo.io ships a newer ripgrep, apt upgrade installs it automatically, with no reinstall step and nothing to rebuild.
Other Tools from deb.griffo.io
The repository packages plenty of tools that pair naturally with ripgrep:
- fzf - a general-purpose fuzzy finder that consumes
rg --filesbeautifully. - eza - a modern replacement for
ls. - Neovim - the hyperextensible Vim-based text editor, which uses ripgrep for its live grep.
- Helix - a post-modern modal editor with ripgrep-powered global search.
Troubleshooting
GPG or Key Errors
If APT reports an unsigned repository or an invalid key, import it again:
curl -fsSL https://deb.griffo.io/EA0F721D231FDD3A0A17B9AC7808B4DD62C41256.asc | sudo gpg --dearmor --yes -o /etc/apt/keyrings/deb.griffo.io.gpg
sudo apt update
Package Not Found
If APT cannot see the ripgrep package:
- Re-run
sudo apt updateafter adding the repository. - Confirm your release is supported (Bookworm, Trixie, Forky, or Sid).
- Inspect the source list:
cat /etc/apt/sources.list.d/deb.griffo.io.list.
APT Installed the Archive Version Instead
Compare the candidates:
apt policy ripgrep
If the Debian archive version is winning, install the repository version explicitly:
sudo apt install ripgrep=15.2.0-1~trixie
Substitute the version string that apt policy lists for deb.griffo.io, matching your release.
A Cargo-Installed rg Shadows the Package
If you previously ran cargo install ripgrep, an older binary in ~/.cargo/bin may take precedence:
which -a rg
Remove it with cargo uninstall ripgrep, or adjust your PATH so /usr/bin/rg wins.
-P Reports That PCRE2 Is Unavailable
That means the binary in your PATH is not this build. Confirm with rg --version: the output should list +pcre2. If it does not, you are running a different ripgrep, so check which -a rg again.
Uninstalling
Remove ripgrep with:
sudo apt remove ripgrep
To also drop the repository and key:
sudo rm /etc/apt/sources.list.d/deb.griffo.io.list
sudo rm /etc/apt/keyrings/deb.griffo.io.gpg
sudo apt update
Conclusion
ripgrep is one of those tools that changes how you work within about ten minutes of installing it. Searching a large repository stops being something you plan around and becomes instant, and the sensible defaults mean you spend far less time excluding node_modules and build output by hand.
Installing it from deb.griffo.io on Debian gets you a current, PCRE2-enabled, dependency-free build, and keeping it that way is just another apt upgrade.
Frequently Asked Questions
How do I install the latest ripgrep on Debian?
Add the deb.griffo.io APT repository and its signing key, then run sudo apt install ripgrep. The repository tracks upstream ripgrep releases, so you get the latest packaged version rather than a build frozen when your distribution was released.
Is there a .deb package for ripgrep?
Yes. deb.griffo.io publishes ripgrep as a signed .deb for Debian. You could download that .deb and install it by hand, but adding the repository is the better option: APT then resolves dependencies and picks up new versions on its own.
How do I update ripgrep to the latest version?
Run sudo apt update && sudo apt upgrade. Once ripgrep is installed from APT there is no separate updater to remember, since new releases arrive with the rest of your system updates.
How do I install ripgrep on Ubuntu?
Exactly the same way; lsb_release -sc simply resolves to a different codename. There is a companion guide with the Ubuntu specifics: How to install ripgrep on Ubuntu.
Which Debian releases are supported?
Bookworm 12, Trixie 13, Forky and Sid. Because the repository line is built from lsb_release -sc, the matching suite is selected for you.
Resources
- ripgrep GitHub Repository
- ripgrep User Guide
- ripgrep FAQ
- deb.griffo.io Repository
- Install guide on deb.griffo.io
Disclaimer: The deb.griffo.io repository is an unofficial community project and is not affiliated with the official Debian or Ubuntu projects, or with the upstream ripgrep project.