install rustup failed, err "it looks like you have an existing installation of Rust"

本文介绍了解决在已安装Rust的情况下无法安装rustup的问题。首先,通过sudo apt-get remove rustc卸载已存在的rustc,然后使用curl https://sh.rustup.rs -sSf | sh命令重新安装rustup,并确保环境变量生效。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

error: it looks like you have an existing installation of Rust at:
error: /home/pnkfelix/bin
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

上述error表明

如果你用命令“curl https://sh.rustup.rs -sSf | sh” 安装rustup失败,提示上述error,则可参照下述方案解决问题:

上述error的意思是你已经安装了rustc,而装rustup是要求不能预装rustc的,因此,你需要先把旧的rustc卸载掉,再重新装rustup,即可;

 

1.sudo apt-get remove rustc

   卸载rustc

 2. curl https://sh.rustup.rs -sSf | sh

重装rustup,安装步骤参考 https://skyao.io/learning-rust/installation/linux.html

3. source $HOME/.cargo/env

  环境变量生效

4. 重启terminal

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值