< 返回我的博客

Mike Tang 发表于 2020-04-21 20:10

Tags:rust,rustup

万众期待的 rustup 镜像也来了,还没有做服务器自动更新,暂时先内测。

RUSTUP_DIST_SERVER=http://mirrors.rustcc.cn RUSTUP_UPDATE_ROOT=http://mirrors.rustcc.cn/rustup rustup install stable

或者把下面两行添加到你的 .bashrc 或 .bash_profile 中

export RUSTUP_DIST_SERVER=http://mirrors.rustcc.cn
export RUSTUP_UPDATE_ROOT=http://mirrors.rustcc.cn/rustup

自测效果还可以,对 Windows 下的 rustup-init.exe 同样有效(需要把上面两个变量加入环境变量键值对里面,然后再双击 rustup-init.exe,你懂的)

带宽有限,请节约使用。

评论区

写评论
rdigua 2020-04-22 21:12

整体来说还算顺利 就是不知道 rust-docs 用时特别长

还有安装后清理时间更多 info: cleaning up downloads & tmp directories

总而言之 顺顺利利 远远满满

rdigua 2020-04-22 21:08
D:\gitpath\pro\memorandum\rust\reading>rustup --version
rustup 1.21.1 (7832b2ebe 2019-12-20)

D:\gitpath\pro\memorandum\rust\reading>set RUSTUP_DIST_SERVER=http://mirrors.rustcc.cn

D:\gitpath\pro\memorandum\rust\reading>set RUSTUP_UPDATE_ROOT=http://mirrors.rustcc.cn/rustup

D:\gitpath\pro\memorandum\rust\reading>rustup install nightly
info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc'
warning: Signature verification failed for 'http://mirrors.rustcc.cn/dist/channe
l-rust-nightly.toml'
info: latest update on 2020-04-21, rust version 1.44.0-nightly (20fc02f83 2020-0
4-20)
info: downloading component 'cargo'
  3.3 MiB /   3.3 MiB (100 %) 806.4 KiB/s in 10s ETA:  0s
info: downloading component 'clippy'
  1.3 MiB /   1.3 MiB (100 %)   1.3 MiB/s in  5s ETA:  0s
info: downloading component 'rust-docs'
 12.2 MiB /  12.2 MiB (100 %) 599.6 KiB/s in 47s ETA:  0s
info: downloading component 'rust-std'
 14.9 MiB /  14.9 MiB (100 %) 594.8 KiB/s in 52s ETA:  0s
info: downloading component 'rustc'
 36.4 MiB /  36.4 MiB (100 %) 596.5 KiB/s in  3m 40s ETA:  0s
info: downloading component 'rustfmt'
  2.0 MiB /   2.0 MiB (100 %) 878.1 KiB/s in 16s ETA:  0s
info: installing component 'cargo'
  4 IO-ops /   4 IO-ops (100 %)   3 IOPS in  1s ETA:  0s
info: installing component 'clippy'
info: installing component 'rust-docs'
 12.2 MiB /  12.2 MiB (100 %) 257.6 KiB/s in 39m 29s ETA:  0s
info: installing component 'rust-std'
 14.9 MiB /  14.9 MiB (100 %)   6.1 MiB/s in  2m 19s ETA:  0s
  5 IO-ops /   5 IO-ops (100 %)   0 IOPS in 27s ETA:  0s
info: installing component 'rustc'
 36.4 MiB /  36.4 MiB (100 %)  10.4 MiB/s in 37s ETA:  0s
  8 IO-ops /   8 IO-ops (100 %)   0 IOPS in  1m 13s ETA:  0s
info: installing component 'rustfmt'

  nightly-x86_64-pc-windows-msvc installed - (timeout reading rustc version)

info: checking for self-updates

D:\gitpath\pro\memorandum\rust\reading>rustc --version
rustc 1.42.0 (b8cedc004 2020-03-09)

D:\gitpath\pro\memorandum\rust\reading>rustup show 

Default host: x86_64-pc-windows-msvc 
rustup home:  C:\Users\Administrator\.rustup

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

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

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

stable-x86_64-pc-windows-msvc (default)
rustc 1.42.0 (b8cedc004 2020-03-09)

D:\gitpath\pro\memorandum\rust\reading>rustup self update
info: checking for self-updates

D:\gitpath\pro\memorandum\rust\reading>rustup --version
rustup 1.21.1 (7832b2ebe 2019-12-20)

D:\gitpath\pro\memorandum\rust>rustup update
info: syncing channel updates for 'stable-x86_64-pc-windows-gnu'
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc'
info: checking for self-updates

    stable-x86_64-pc-windows-gnu unchanged - rustc 1.42.0 (b8cedc004 2020-03-09)

   stable-x86_64-pc-windows-msvc unchanged - rustc 1.42.0 (b8cedc004 2020-03-09)

  nightly-x86_64-pc-windows-msvc unchanged - rustc 1.44.0-nightly (20fc02f83 202
0-04-20)

info: cleaning up downloads & tmp directories
作者 Mike Tang 2020-04-22 09:20

应该是你这里用错了:

D:\gitpath\pro\memorandum\rust\reading>set RUSTUP_UPDATE_ROOT=http://mirrors.rus
tcc.cn/rustup rustup install stable

%20 就是空格。

Windows 下,环境变量不能加在命令前面设置,要单独一行。或者在环境变量界面里面去设置键值对。

作者 Mike Tang 2020-04-22 09:18

不,是这个

http://mirrors.rustcc.cn/rustup%20rustup%20
install%20stable/release-stable.toml

%20 符号,导致 404,因为没有这个文件。我看看原因。

作者 Mike Tang 2020-04-22 09:15

好像 self update 环境变量配置不起作用?

rdigua 2020-04-22 01:17
D:\gitpath\pro\memorandum\rust\reading>set RUSTUP_DIST_SERVER=http://mirrors.rus
tcc.cn

D:\gitpath\pro\memorandum\rust\reading>set RUSTUP_UPDATE_ROOT=http://mirrors.rus
tcc.cn/rustup rustup install stable

D:\gitpath\pro\memorandum\rust\reading>rustup update
info: syncing channel updates for 'stable-x86_64-pc-windows-gnu'
warning: Signature verification failed for 'http://mirrors.rustcc.cn/dist/channe
l-rust-stable.toml'
info: latest update on 2020-03-12, rust version 1.42.0 (b8cedc004 2020-03-09)
info: downloading component 'rustc'
info: downloading component 'rust-std'
info: downloading component 'cargo'
info: downloading component 'rust-docs'
info: downloading component 'rust-mingw'
info: removing previous version of component 'rustc'
info: removing previous version of component 'rust-std'
info: removing previous version of component 'cargo'
info: removing previous version of component 'rust-docs'
warning: during uninstall component rust-docs was not found
info: removing previous version of component 'rust-mingw'
warning: during uninstall component rust-mingw was not found
info: installing component 'rustc'
 52.5 MiB /  52.5 MiB (100 %)   3.5 MiB/s in  1m  5s ETA:  0s
  9 IO-ops /   9 IO-ops (100 %)   0 IOPS in  2m 13s ETA:  0s
info: installing component 'rust-std'
 15.5 MiB /  15.5 MiB (100 %)  12.2 MiB/s in  5s ETA:  0s
  9 IO-ops /   9 IO-ops (100 %)   0 IOPS in 25s ETA:  0s
info: installing component 'cargo'
  4.9 MiB /   4.9 MiB (100 %)  48.0 KiB/s in 22s ETA:  0s
  8 IO-ops /   8 IO-ops (100 %)   0 IOPS in 19s ETA:  0s
info: installing component 'rust-docs'
 12.0 MiB /  12.0 MiB (100 %) 249.6 KiB/s in 42m 49s ETA:  0s
  9 IO-ops /   9 IO-ops (100 %)   1 IOPS in  3s ETA:  0s
info: installing component 'rust-mingw'
  4.2 MiB /   4.2 MiB (100 %) 344.0 KiB/s in  1m 24s ETA:  0s
  8 IO-ops /   8 IO-ops (100 %)   0 IOPS in 16s ETA:  0s
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
warning: Signature verification failed for 'http://mirrors.rustcc.cn/dist/channe
l-rust-stable.toml'
info: latest update on 2020-03-12, rust version 1.42.0 (b8cedc004 2020-03-09)
info: downloading component 'rustc'
 35.6 MiB /  35.6 MiB (100 %) 620.6 KiB/s in  2m 42s ETA:  0s
info: downloading component 'rust-std'
 14.8 MiB /  14.8 MiB (100 %) 600.5 KiB/s in 58s ETA:  0s
info: downloading component 'cargo'
  3.1 MiB /   3.1 MiB (100 %) 714.3 KiB/s in 14s ETA:  0s
info: downloading component 'rust-docs'
 12.0 MiB /  12.0 MiB (100 %) 597.4 KiB/s in 46s ETA:  0s
info: downloading component 'rls'
  5.3 MiB /   5.3 MiB (100 %) 615.9 KiB/s in 31s ETA:  0s
info: downloading component 'rust-src'
  2.2 MiB /   2.2 MiB (100 %) 983.5 KiB/s in 25s ETA:  0s
info: downloading component 'rust-analysis'
  1.6 MiB /   1.6 MiB (100 %) 147.4 KiB/s in 12s ETA:  0s
info: downloading component 'clippy'
info: downloading component 'rustfmt'
  1.8 MiB /   1.8 MiB (100 %)   1.3 MiB/s in 12s ETA:  0s
info: removing previous version of component 'rustc'
info: removing previous version of component 'rust-std'
info: removing previous version of component 'cargo'
info: removing previous version of component 'rust-docs'
info: removing previous version of component 'rls'
info: removing previous version of component 'rust-src'
info: removing previous version of component 'rust-analysis'
info: removing previous version of component 'clippy'
info: removing previous version of component 'rustfmt'
info: installing component 'rustc'
 35.6 MiB /  35.6 MiB (100 %)  12.2 MiB/s in  5m 12s ETA:  0s
  9 IO-ops /   9 IO-ops (100 %)   0 IOPS in 22s ETA:  0s
  6 IO-ops /   6 IO-ops (100 %)   0 IOPS in  2m 18s ETA:  0s
info: installing component 'rust-std'
 14.8 MiB /  14.8 MiB (100 %)  12.2 MiB/s in 13s ETA:  0s
  9 IO-ops /   9 IO-ops (100 %)   0 IOPS in 30s ETA:  0s
info: installing component 'cargo'
  3.1 MiB /   3.1 MiB (100 %)  40.0 KiB/s in 36s ETA:  0s
  7 IO-ops /   7 IO-ops (100 %)   1 IOPS in  1s ETA:  0s
info: installing component 'rust-docs'
 12.0 MiB /  12.0 MiB (100 %) 244.8 KiB/s in 35m 33s ETA:  0s
info: installing component 'rls'
  8 IO-ops /   8 IO-ops (100 %)   0 IOPS in 10s ETA:  0s
info: installing component 'rust-src'
  2.2 MiB /   2.2 MiB (100 %) 123.2 KiB/s in  2m 54s ETA:  0s
  6 IO-ops /   6 IO-ops (100 %)   0 IOPS in  5s ETA:  0s
info: installing component 'rust-analysis'
info: installing component 'clippy'
  5 IO-ops /   5 IO-ops (100 %)   2 IOPS in  1s ETA:  0s
info: installing component 'rustfmt'
info: checking for self-updates
error: could not download file from 'http://mirrors.rustcc.cn/rustup%20rustup%20
install%20stable/release-stable.toml' to 'C:\Users\ADMINI~1\AppData\Local\Temp\r
ustup-updateHOUbq0\release-stable.toml'
error: caused by: http request returned an unsuccessful status code: 404

D:\gitpath\pro\memorandum\rust\reading>rustup update
info: syncing channel updates for 'stable-x86_64-pc-windows-gnu'
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: checking for self-updates
error: could not download file from 'http://mirrors.rustcc.cn/rustup%20rustup%20
install%20stable/release-stable.toml' to 'C:\Users\ADMINI~1\AppData\Local\Temp\r
ustup-update95Q2Av\release-stable.toml'
error: caused by: http request returned an unsuccessful status code: 404

rdigua 2020-04-21 21:43

很丝滑

很顺流

500k往上的酱紫

目前超级满意 打算把 windows也加上 night 版了 原来只有std

1 共 7 条评论, 1 页