How to uninstall Rust that was installed via rustup?

Viewed 63510

I installed Rust on my Ubuntu 16.04 machine through

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

as can be seen on the Installation Page.

How do I now uninstall Rust?

4 Answers

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
Related