rust切换老版本及卸载指定版本

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

在这里插入图片描述

参考资料:
[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

猜你喜欢

转载自blog.csdn.net/mutourend/article/details/100104378