rustup: Can't install rustup because of existing rust that I can't remove
We have a copy of rustc version 1.14.0 installed on my school’s server. I want to set up the latest version of rust (currently 1.15.1) in my home directory, ideally using rustup. But because of the existing copy of rust - which I can’t remove, since I don’t have root access - rustup-init fails with the following error:
warning: it looks like you have an existing installation of Rust
warning: rustup cannot be installed alongside Rust. Please uninstall first
warning: run `/usr/local/lib/rustlib/uninstall.sh` as root to uninstall Rust
error: cannot install while Rust is installed
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 14
- Comments: 27 (4 by maintainers)
Commits related to this issue
- Allow installing alongside existing Rust (with warning) See https://github.com/rust-lang/rustup/issues/953 — committed to sollyucko/rustup by sollyucko 4 years ago
- Allow installing alongside existing Rust (with warning) See https://github.com/rust-lang/rustup/issues/953 — committed to BeniCheni/rustup.rs by sollyucko 4 years ago
Just run:
sudo apt remove rustcthencurl https://sh.rustup.rs/ -sSf | shYou can bypass the check by setting
RUSTUP_INIT_SKIP_PATH_CHECKtoyes:I think the error message should at least mention this environment variable – I only found it after looking through the source of
rustup-init.Sorry for the late reply.
You just need to run: curl -sSf https://static.rust-lang.org/rustup.sh | sh
it will fix the problem.
After compiling all above comments, I used following command and it worked perfectly with previously installed rust. curl https://sh.rustup.rs -sSf | RUSTUP_INIT_SKIP_PATH_CHECK=yes sh
Yes, use
I wonder why can’t rustup have a special
systemtoolchan, that cannot be installed or updated but can be chosen.@ssowellsvt - Spot on - Thanks!
Anyway, it looks like the issue was fixed in https://github.com/rust-lang/rustup.rs/pull/705. You can now add the
-yoption to skip the check for an existingrustcorcargobinary inPATH, and this is referenced in the error message.https://doc.rust-lang.org/1.0.0/book/installing-rust.html
Please follow this link.
On Thu, Jan 17, 2019 at 4:25 AM Michael Hewson notifications@github.com wrote: