rustup: Failed to uninstall on macOS 10.13.2
Uninstalling Rust via rustup failed with following message, even there still be the directory exists.
error: could not remove 'cargo_home' directory: '/Users/user/.cargo'
info: caused by: No such file or directory (os error 2)
Environment is
- macOS 10.13.2
- Bash
The following is what I did and step to reproduce.
MacBook-Pro:~ user$ curl https://sh.rustup.rs -sSf | sh
info: downloading installer
Welcome to Rust!
This will download and install the official compiler for the Rust programming
language, and its package manager, Cargo.
It will add the cargo, rustc, rustup and other commands to Cargo's bin
directory, located at:
/Users/user/.cargo/bin
This path will then be added to your PATH environment variable by modifying the
profile files located at:
/Users/user/.profile
/Users/user/.bash_profile
You can uninstall at any time with rustup self uninstall and these changes will
be reverted.
Current installation options:
default host triple: x86_64-apple-darwin
default toolchain: stable
modify PATH variable: yes
1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
1
info: syncing channel updates for 'stable-x86_64-apple-darwin'
info: latest update on 2018-01-04, rust version 1.23.0 (766bd11c8 2018-01-01)
info: downloading component 'rustc'
35.9 MiB / 35.9 MiB (100 %) 19.7 MiB/s ETA: 0 s
info: downloading component 'rust-std'
49.1 MiB / 49.1 MiB (100 %) 20.8 MiB/s ETA: 0 s
info: downloading component 'cargo'
info: downloading component 'rust-docs'
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'cargo'
info: installing component 'rust-docs'
info: default toolchain set to 'stable'
stable installed - rustc 1.23.0 (766bd11c8 2018-01-01)
Rust is installed now. Great!
To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH
environment variable. Next time you log in this will be done automatically.
To configure your current shell run source $HOME/.cargo/env
MacBook-Pro:~ user$ rustup self uninstall
Thanks for hacking in Rust!
This will uninstall all Rust toolchains and data, and remove $HOME/.cargo/bin
from your PATH environment variable.
Continue? (y/N) y
info: removing rustup home
info: removing cargo home
info: removing rustup binaries
error: could not remove 'cargo_home' directory: '/Users/user/.cargo'
info: caused by: No such file or directory (os error 2)
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 5
- Comments: 16 (3 by maintainers)
Hit for this today.
What it make it worse, is that rustup is deleted before. So run again:
I totally expect the “uninstaller” is the last program to go…
I’ve been digging some code. The error string is tied to the
RemovingDirectoryerror. This error seems to lead toremove_dir(). Though, I’m not sure if and whyfs::symlink_metadata()orremove_dir_all::remove_dir_all()fail.Whats worse: As a user I don’t know how incomplete the uninstallation is 👎