How to remove Rust compiler using Rustup?

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

While the docs really show how to completely remove rustup , I would like to maintain a stable branch.

How can I remove Rust at night?


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

Despite the fact that I read the documentation, it is not clear that nightly was a toolchain , a channel ... or something else.

+8
source share
2 answers

The command you are looking for is:

 rustup toolchain remove nightly 

remove and uninstall work for this.

For more details see:

 rustup help toolchain 
+15
source

First, see what versions you have with this command:

 rustup toolchain list 

Output (for example):

 stable-x86_64-pc-windows-gnu stable-x86_64-pc-windows-msvc nightly-x86_64-pc-windows-gnu nightly-x86_64-pc-windows-msvc (default) 

Then remove the named item that you want from the list above (for example):

 rustup toolchain remove nightly-x86_64-pc-windows-msvc 

And then you may need to look at the default value by running the rustup toolchain list again, the output (here for me: no):

 stable-x86_64-pc-windows-gnu stable-x86_64-pc-windows-msvc 

and set the desired default value (for example):

 rustup default stable-x86_64-pc-windows-gnu 

and confirm the result by running the rustup toolchain list , see:

 stable-x86_64-pc-windows-gnu (default) stable-x86_64-pc-windows-msvc 

When using the rustup toolchain remove nightly the rustup toolchain remove nightly with four elements installed that works only for the rustup toolchain remove nightly nightly-x86_64-pc-windows-gnu if you have several versions installed (even if you run the rustup toolchain remove nightly twice or more:
Now, if you run the rustup toolchain remove nightly output:

 info: uninstalling toolchain 'nightly-x86_64-pc-windows-gnu' info: toolchain 'nightly-x86_64-pc-windows-gnu' uninstalled 

Run rustup toolchain remove nightly again rustup toolchain remove nightly , output:

 info: no toolchain installed for 'nightly-x86_64-pc-windows-gnu' 

Hope this helps.

0
source

Source: https://habr.com/ru/post/1264404/


All Articles