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 。
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