Rustup: Setting "rustup default nightly" and back to stable ends up using older leftover version

Created on 12 May 2016  路  11Comments  路  Source: rust-lang/rustup

$ rustc --version
rustc 1.8.0
$ rustup toolchain install nightly
...
$ rustup default nightly
...
$ rustc --version
rustc 1.4.0-dev
$ rustup default stable
info: using existing install for 'stable-x86_64-unknown-linux-gnu'
info: default toolchain set to 'stable-x86_64-unknown-linux-gnu'

  stable-x86_64-unknown-linux-gnu unchanged - rustc 1.8.0 (db2939409 2016-04-11)

$  rustc --version
rustc 1.4.0-dev
$ rustup show
installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu (default)
nightly-x86_64-unknown-linux-gnu

active toolchain
----------------

stable-x86_64-unknown-linux-gnu (default)
rustc 1.8.0 (db2939409 2016-04-11)
$ rustup self uninstall
...
$ rustc --version
rustc 1.4.0-dev
$ which rustc
/usr/bin/rustc
$ /usr/bin/rustc --version
rustc 1.4.0-dev
$ ls -la /usr/bin/rustc         
lrwxrwxrwx 1 root root 23 Feb  6 10:50 /usr/bin/rustc -> /etc/alternatives/rustc
$ ls -la /etc/alternatives/rustc
lrwxrwxrwx 1 root root 35 Feb  6 10:50 /etc/alternatives/rustc -> /usr/lib/rust/rust-stable/bin/rustc
$ ls -la /usr/lib/rust/rust-stable/bin/rustc
-rwxr-xr-x 1 root root 6064 Nov  1  2015 /usr/lib/rust/rust-stable/bin/rustc
$ /usr/lib/rust/rust-stable/bin/rustc --version
rustc 1.4.0-dev

Switching to a new terminal didn't help (I was wondering if there were some env vars set that were causing this), there is nothing suspicious in ~/.profile, installing rustup again didn't help. Now I'm not sure how to get back to the 1.8 version, because /usr/local/lib/rustlib/uninstall.sh doesn't exist anymore (I ran it before installing rustup). Now what? Should I try to manually delete the files?

Most helpful comment

Thanks for the report.

This is probably an artifact of rustup's poor multirust->rustup migration, especially if you installed rustup prior to 0.1.12 (after that rustup should refuse to install if it looks like multirust is installed).

I'd recommend deleting ~/.multirust then restoring it with rustup default nightly.

All 11 comments

I'm not sure why version 1.4 is still lying around after all that time. It doesn't seem to have an uninstall script though, so I just deleted the files manually. I'm not sure if this is a bug in rustup or just in the old rust version.

Thanks for the report.

This is probably an artifact of rustup's poor multirust->rustup migration, especially if you installed rustup prior to 0.1.12 (after that rustup should refuse to install if it looks like multirust is installed).

I'd recommend deleting ~/.multirust then restoring it with rustup default nightly.

I'm having the same issue. Rust version 1.34/1.35 and rustup version 1.17

I can't switch back to "stable"

Could you please show me the output of rustup show ?

rustup show

Default host: x86_64-apple-darwin

installed toolchains
--------------------

stable-x86_64-apple-darwin (default)
beta-x86_64-apple-darwin
nightly-x86_64-apple-darwin

active toolchain
----------------

nightly-x86_64-apple-darwin (directory override for '/****')
rustc 1.35.0-nightly (96d700f1b 2019-04-10)

Okay. I just noticed the "directory override" thing but if I run "rustup default stable" it is supposed to change it?

Edit: If I run "rustc --version" outside of that directory, it points to stable. So rust is feeding from some parameter in that directory?

The default is overridden by directory overrides.

Thanks. I can confirm this resolved the issue. I wasn't aware of directory override and somehow, somewhere along the project it got set.

Is there any update to this? This crate fails to built on nightly 1.45.0. Building from source as is suggested elsewhere also does not work.

@cvanelteren So far noone has presented anything which needs fixing per-se. What is "this crate" which you are failing to build? Did you perhaps comment on the wrong issue.

@kinnison my bad I think in my searching I accidentally commented on this instead of faster.

Was this page helpful?
0 / 5 - 0 ratings