Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove Rust compiler toolchains with Rustup?

Tags:

rust

rustup

The Rustup documentation shows how to install Rust nightly, but not how to remove it.

While the docs do show how to uninstall rustup entirely, I'd like to keep the stable branch.

How can I uninstall Rust nightly?


Note that I attempted to do the opposite of rustup install nightly... (rustup uninstall nightly, rustup remove nightly & rustup delete nightly) to no avail.

Even though I read the documentation it wasn't clear that nightly was a toolchain, a channel... or something else.

like image 776
ideasman42 Avatar asked Feb 19 '17 02:02

ideasman42


People also ask

Can I delete Rustup?

Uninstall Rust in Windows To uninstall Rust in the Windows operating system, we can run the Rustup installer and select uninstall. Go to the terminal in Windows and get into the directory where you have installed Rust.

What is Rustup used for?

Rustup is the official tool used to manage Rust tooling. Not only can it be used to install Rust and keep it updated, it also allows you to seamlessly switch between the stable, beta, and nightly Rust compilers and tooling.

What is Rustup in Rust?

rustup installs The Rust Programming Language from the official release channels, enabling you to easily switch between stable, beta, and nightly compilers and keep them updated. It makes cross-compiling simpler with binary builds of the standard library for common platforms. And it runs on all platforms Rust supports.


2 Answers

The command you're looking for is:

rustup toolchain remove nightly 

remove and uninstall both work for this.

For more details see:

rustup help toolchain 
like image 73
Michael Jungo Avatar answered Sep 19 '22 04:09

Michael Jungo


You might have more than one nightly toolchain installed. To list all installed toolchains, run rustup show. The output will look like this:

Default host: x86_64-unknown-linux-gnu rustup home:  /home/fpoli/.rustup  installed toolchains --------------------  stable-x86_64-unknown-linux-gnu (default) nightly-2018-06-27-x86_64-unknown-linux-gnu nightly-2021-02-24-x86_64-unknown-linux-gnu nightly-2021-09-20-x86_64-unknown-linux-gnu  active toolchain ----------------  stable-x86_64-unknown-linux-gnu (default) rustc 1.54.0 (a178d0322 2021-07-26) 

Now that you know the installed versions, you can remove them with the following command:

rustup toolchain remove nightly-2018-06-27 nightly-2021-02-24 nightly-2021-09-20 
like image 29
Federico Avatar answered Sep 18 '22 04:09

Federico