← 返回命令列表

Linux command

cargo-uninstall 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Uninstall package

cargo uninstall [package]

Uninstall specific binary

cargo uninstall [package] --bin [binary]

Uninstall from custom root

cargo uninstall [package] --root [~/.local]

Uninstall multiple packages

cargo uninstall [pkg1] [pkg2]

说明

cargo uninstall removes packages that were previously installed with `cargo install`. By default it removes all binaries associated with the package. The `--bin` flag can be used to remove only a specific binary while leaving others from the same package in place. The installation root is determined by the `--root` flag, the `CARGO_INSTALL_ROOT` environment variable, the `install.root` configuration value, or `$CARGO_HOME` (defaulting to `~/.cargo`). Only the installed binaries are removed; cached build artifacts in the target directory are not cleaned up.

参数

-p, --package _spec_
Package to uninstall
--bin _name_
Only uninstall specified binary
--example _name_
Only uninstall specified example
--root _dir_
Directory to uninstall from
-v, --verbose
Verbose output (use twice for very verbose)
-q, --quiet
Suppress output
--color _when_
Control colored output: auto, always, or never

FAQ

What is the cargo-uninstall command used for?

cargo uninstall removes packages that were previously installed with `cargo install`. By default it removes all binaries associated with the package. The `--bin` flag can be used to remove only a specific binary while leaving others from the same package in place. The installation root is determined by the `--root` flag, the `CARGO_INSTALL_ROOT` environment variable, the `install.root` configuration value, or `$CARGO_HOME` (defaulting to `~/.cargo`). Only the installed binaries are removed; cached build artifacts in the target directory are not cleaned up.

How do I run a basic cargo-uninstall example?

Run `cargo uninstall [package]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -p, --package _spec_ do in cargo-uninstall?

Package to uninstall