CARGO-UNINSTALL(1)
β¨ CARGO-UNINSTALL β¨
okay bestie, welcome to the cargo-uninstall page of the General Commands Manual π this is the one where we take out the trash (respectfully) and yeet a Rust binary off your machine ποΈβ¨
πΈ NAME πΈ
cargo-uninstall β Remove a Rust binary π«Ά
π SYNOPSIS π
cargo uninstall [options] [specβ¦]
π¦ DESCRIPTION π¦
So this command does the reverse-glow-up move: it removes a package that was installed with cargo-install(1). The spec argument is a package ID specification of the package you want to remove β go check cargo-pkgid(1) if you need the deets on how those specs work π
By default, all binaries get removed for a crate, but if you're picky (and you should be, you're a main character), the --bin and --example flags let you remove only particular binaries π―
Now, where does it look for the install root? The installation root is determined, in order of precedence:
- the
--rootoption π - the
CARGO_INSTALL_ROOTenvironment variable - the
install.rootCargo config value <https://doc.rust-lang.org/cargo/reference/config.html> - the
CARGO_HOMEenvironment variable $HOME/.cargo
like, it goes down that list and the first one that hits, wins π
π OPTIONS π
π Install Options
-p,--packagespecβ¦ β the package you want to uninstall π«‘--binnameβ¦ β only uninstall the binary name βοΈ--rootdir β the directory to uninstall packages from π
β Display Options
-v,--verboseβ use verbose output. You can pass it twice for "very verbose" output, which includes extra output such as dependency warnings and build script output π May also be specified with theterm.verboseconfig value <https://doc.rust-lang.org/cargo/reference/config.html>.-q,--quietβ do not print cargo log messages π€« May also be specified with theterm.quietconfig value <https://doc.rust-lang.org/cargo/reference/config.html>.--colorwhen β control when colored output is used π¨ valid values are:auto(default): automatically detect if color support is available on the terminal β¨always: always display colors πnever: never display colors π- May also be specified with the
term.colorconfig value <https://doc.rust-lang.org/cargo/reference/config.html>.
π Common Options
+toolchainβ if Cargo has been installed with rustup, and the first argument tocargobegins with+, it will be interpreted as a rustup toolchain name (such as+stableor+nightly) π οΈ See the rustup documentation <https://rust-lang.github.io/rustup/overrides.html> for more information about how toolchain overrides work.--configKEY=VALUE or PATH β overrides a Cargo configuration value. The argument should be in TOML syntax ofKEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times π See the command-line overrides section <https://doc.rust-lang.org/cargo/reference/config.html#command-line-overrides> for more information.-CPATH β changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering.cargo/config.toml, for example π This option must appear before the command name, for examplecargo -C path/to/my-project build.
β οΈ heads up bestie: this option is only available on the nightly channel <https://doc.rust-lang.org/book/appendix-07-nightly-rust.html> and requires the -Z unstable-options flag to enable (see #10098 <https://github.com/rust-lang/cargo/issues/10098>) π¨
-h,--helpβ prints help information π-Zflag β unstable (nightly-only) flags to Cargo π runcargo -Z helpfor details.
π± ENVIRONMENT π±
See the reference <https://doc.rust-lang.org/cargo/reference/environment-variables.html> for details on environment variables that Cargo reads π
π EXIT STATUS π
0: Cargo succeeded β101: Cargo failed to complete π
π EXAMPLES π
- Uninstall a previously installed package.
cargo uninstall ripgrep
π SEE ALSO π
cargo(1), cargo-install(1) π
and that's the whole page, no cap π§ this was CARGO-UNINSTALL(1) from the General Commands Manual β go forth, uninstall responsibly, and remember: removing a binary is still a slay π β¨
π¦ where this page comes from
- ubuntu jammy: cargo-1.79 1.79.0+dfsg1ubuntu1~bpo0-0ubuntu0.22.04.1 Β· Apache-2.0 WITH LLVM exception
- ubuntu noble: cargo-1.79 1.79.0+dfsg1ubuntu1-0ubuntu0.24.04.1 Β· MIT OR Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms