在Windows的Linux子系统上安装Rust,习惯性的用了sudo apt install cargo
。结果发现所有安装以后的Rust并非最新版本。想要用Rust官方提供的脚本安装最新版本却出现错误:git
error: it looks like you have an existing installation of Rust at: error: /mnt/g/ error: rustup cannot be installed alongside Rust. Please uninstall first error: if this is what you want, restart the installation with `-y' error: cannot install while Rust is installed
网上不少答案说删除安装的rustc
就能够了,结果发现依然失败。最后终于在GitHub issue里找到一个能够用的方法。github
删除安装的rustc
ide
sudo apt-get -y remove rustc cargo sudo apt -y autoremove
下载自动安装脚本 https://sh.rustup.rsthis
命令行中运行命令行
RUSTUP_INIT_SKIP_PATH_CHECK=yes sh ./rustup-init.sh