1. 查看当前系统已安装的rust版本

ls /root/.rustup/toolchains/

在这里插入图片描述

安装指定版本(如1.56),可为:

$ rustup install 1.56

安装指定的nightly 版本,可为:

$ rustup toolchain install nightly-2021-11-01

2. 切换回过去的某个指定版本

rustup default xxxxx

在这里插入图片描述
若提示当前rust版本使用中,可修改相应的toolchain文件即可。具体参照 https://users.rust-lang.org/t/how-can-i-revert-to-older-version-of-rust/20497 。

在这里插入图片描述

3. 卸载指定版本rustup toolchain

rustup help toolchain
rustup toolchain uninstall xxx

在这里插入图片描述

4. 卸载及安装

卸载rustup:

rustup self uninstall

重新安装rustup

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

参考资料:

[1] https://users.rust-lang.org/t/how-can-i-revert-to-older-version-of-rust/20497
[2] https://stackoverflow.com/questions/42322879/how-to-remove-rust-compiler-toolchains-with-rustup
[3] https://rust-lang.github.io/rustup/concepts/channels.html
[4] Error: linking with cc failed: exit status: 1

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐