`rustup update` failing with could not rename component file
Closed this issue ยท 11 comments
[santiago@galago ~]$ rustup --version
rustup 1.23.1 (2020-12-18)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.53.0-nightly (b84932674 2021-04-21)`
[santiago@galago ~]$ rustup update
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: syncing channel updates for 'beta-x86_64-unknown-linux-gnu'
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: latest update on 2021-04-23, rust version 1.53.0-nightly (7f4afdf02 2021-04-22)
info: downloading component 'rust-std' for 'i686-unknown-linux-gnu'
info: downloading component 'rustc-dev'
95.0 MiB / 95.0 MiB (100 %) 36.6 MiB/s in 2s ETA: 0s
info: downloading component 'rust-src'
info: downloading component 'rust-analyzer-preview'
info: downloading component 'rust-analysis'
info: downloading component 'rls'
info: downloading component 'miri'
info: downloading component 'llvm-tools-preview'
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-std'
info: downloading component 'rustc'
48.8 MiB / 48.8 MiB (100 %) 36.8 MiB/s in 1s ETA: 0s
info: downloading component 'rustfmt'
info: removing previous version of component 'rust-std' for 'i686-unknown-linux-gnu'
info: removing previous version of component 'rustc-dev'
info: removing previous version of component 'rust-src'
info: removing previous version of component 'rust-analyzer-preview'
info: removing previous version of component 'rust-analysis'
info: removing previous version of component 'rls'
info: removing previous version of component 'miri'
info: removing previous version of component 'llvm-tools-preview'
info: removing previous version of component 'cargo'
info: removing previous version of component 'clippy'
info: removing previous version of component 'rust-docs'
info: removing previous version of component 'rust-std'
info: removing previous version of component 'rustc'
info: removing previous version of component 'rustfmt'
info: installing component 'rust-std' for 'i686-unknown-linux-gnu'
info: using up to 500.0 MiB of RAM to unpack components
24.3 MiB / 24.3 MiB (100 %) 13.0 MiB/s in 2s ETA: 0s
info: installing component 'rustc-dev'
95.0 MiB / 95.0 MiB (100 %) 13.1 MiB/s in 7s ETA: 0s
info: installing component 'rust-src'
info: installing component 'rust-analyzer-preview'
info: installing component 'rust-analysis'
info: installing component 'rls'
info: installing component 'miri'
info: installing component 'llvm-tools-preview'
21.4 MiB / 21.4 MiB (100 %) 13.9 MiB/s in 1s ETA: 0s
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
16.0 MiB / 16.0 MiB (100 %) 9.6 MiB/s in 1s ETA: 0s
info: rolling back changes
error: could not rename component file from '/home/santiago/.rustup/tmp/zf6jna9jd15jb4u__dir/bk' to '/home/santiago/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/share/man'
error: could not rename component file from '/home/santiago/.rustup/tmp/cduhrqr9cfacgp11_dir/bk' to '/home/santiago/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu'
error: could not rename component file from '/home/santiago/.rustup/tmp/df3zlcanlr6x35r5_dir/bk' to '/home/santiago/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/share/zsh'
error: could not rename component file from '/home/santiago/.rustup/tmp/ix1dug784t7aeozn_dir/bk' to '/home/santiago/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/etc'
error: could not rename component file from '/home/santiago/.rustup/tmp/l9rfug8ahze2fpjn_dir/bk' to '/home/santiago/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src'
...
@spastorino Kinnison said on discord:
This happens if the component file gets corrupted. The easiest fix is to uninstall and reinstall the toolchain.
wheres the actual end of the output? I see the rollback start, but not the actual original error that triggered the rollback.
The could-not-renames are just symptoms of whatever the problem was I think
ohh yeah I see the problem
error: failed to install component: 'rust-docs-x86_64-unknown-linux-gnu', detected conflict: '"share/doc/rust/html"'
Uninstalled and installed again and it's now working. Anyway, unsure what happened or how the component file got corrupted.
dup of #2417
Newbie to rust here. Exactly how to "uninstall and reinstall the toolchain", please? This is my year to grok rust and this is my first issue.
rustup toolchain uninstall stable && rustup toolchain install stable
, replacing stable
with the toolchain name that errored for you.
Thanks! I'm a pretty goof guesser, but I could've gone a long time before coming up wit that on my own!
what lol ! FR just trying the install again worked smh ugghhhh thanks all lol
Had the exact same problem, fixed by closing the IDE (vscode in my case) hehe
I think rust-analyzer plugin was blocking the folder.