Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install ripgrep on Ubuntu
#!/bin/bash
[[ $UID == 0 ]] || { echo "run as sudo to install"; exit 1; }
REPO="https://github.com/BurntSushi/ripgrep/releases/download/"
RG_LATEST=$(curl -sSL "https://api.github.com/repos/BurntSushi/ripgrep/releases/latest" | jq --raw-output .tag_name)
RELEASE="${RG_LATEST}/ripgrep-${RG_LATEST}-x86_64-unknown-linux-musl.tar.gz"
TMPDIR=$(mktemp -d)
cd $TMPDIR
wget -O - ${REPO}${RELEASE} | tar zxf - --strip-component=1
mv rg /usr/local/bin/
mv rg.1 /usr/local/share/man/man1/
mv complete/rg.bash-completion /usr/share/bash-completion/completions/rg
mandb
@arizzubair

This comment has been minimized.

Copy link

@arizzubair arizzubair commented Aug 2, 2019

From apt:

sudo add-apt-repository ppa:x4121/ripgrep
sudo apt-get update
@kakulukia

This comment has been minimized.

Copy link

@kakulukia kakulukia commented Apr 16, 2020

thx!

@jorgeav527

This comment has been minimized.

Copy link

@jorgeav527 jorgeav527 commented May 15, 2020

thx! man

@AstraWalker

This comment has been minimized.

Copy link

@AstraWalker AstraWalker commented Jan 30, 2021

Hello, need your help. The matter is that Mint does not accept that ppa. Moreover, as a result of script effect there is no opportunity to install ripgrep other way - error with reference to /var/..../ripgrep...deb. and json file.
I need your help to revive it back, please.

@nhed

This comment has been minimized.

Copy link

@nhed nhed commented Feb 12, 2021

Observed that in current release (12.1.1) rg1 is now in the doc subdir

$ curl -Ls  https://github.com/BurntSushi/ripgrep/releases/download/12.1.1/ripgrep-12.1.1-x86_64-unknown-linux-musl.tar.gz | \
    tar -ztf - | grep 'rg\.1'
ripgrep-12.1.1-x86_64-unknown-linux-musl/doc/rg.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment