Windows Linux子系统使用rustup重新安装Rust

在Windows的Linux子系统上安装Rust,习惯性的用了sudo apt install cargo。结果发现全部安装之后的Rust并不是最新版本。想要用Rust官方提供的脚本安装最新版本却出现错误:

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里找到一个可以用的方法

如何在Ubuntu中解决Rust重装

  1. 删除安装的rustc

    sudo apt-get -y remove rustc cargo
    sudo apt -y autoremove
    
  2. 下载自动安装脚本 https://sh.rustup.rs

  3. 命令行中运行

    RUSTUP_INIT_SKIP_PATH_CHECK=yes sh ./rustup-init.sh
    
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值