ideasman42
ideasman42

Reputation: 48198

How to remove Rust compiler toolchains with 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 ...

... to no avail.

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

Upvotes: 58

Views: 40828

Answers (2)

Federico
Federico

Reputation: 2133

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

Upvotes: 21

Michael Jungo
Michael Jungo

Reputation: 32992

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

Upvotes: 102

Related Questions