How do I list all of the packages I've installed globally with cargo install?

Viewed 8551

I've installed several CLI tools using cargo install (for instance, ripgrep). How do I see a list of all the crates I've downloaded using cargo install? Sort of like apt list --installed but for cargo?

3 Answers

The command line

cargo help install

produces detailed help information. Among others it lists common EXAMPLES, e.g.

  1. View the list of installed packages:

    cargo install --list
    

ls ~/.cargo/bin/

The binary files are stored here, so listing all the files in this directory will give you all the global cargo crates you've installed.

If you want to manipulate the list shown by cargo install --list, then please check:

cat $CARGO_HOME/bin/.crates.toml
cat $CARGO_HOME/bin/.crates2.json | jq .

Please note that .crates2.json is in json format.

Related