如何卸载通过升级安装的 Rust?

我在我的 Ubuntu 16.04机器上安装了 Rust

curl https://sh.rustup.rs -sSf | sh

安装页上可以看到。

现在如何卸载 Rust?

72465 次浏览

To uninstall rustc, rustup and cargo from my Ubuntu 16.04 installation, I did:

rustup self uninstall

and it worked.

If you pay attention to the message you get while installing, you will find the command you are looking for:

Rust uninstall command

As for Linux based operating systems, the following command can be used:

rustup self uninstall

this will remove all the Rust Compiler, Tool Chains and Data including rustc and cargo If you're one window this should wok, but you have to remove C++ build tools manually if you want to remove it as well, though I would never recommend.

You can do this without manually deleting the old rust binaries by uninstalling cargo and then auto-removing its now un-needed dependencies:

sudo apt remove cargo
sudo apt autoremove