繁体   English   中英

我们如何才能完全删除 Ubuntu 安装的 Rust?

[英]How can we completely remove Rust installed by Ubuntu?

我想将我的 Rust 更新到最新版本,但是当我搜索rustup时,它没有出现在我的系统中rustup: command not found 我尝试使用curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh安装 rustup curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh 它发出了这个警告。

warning: rustup should not be installed alongside Rust. Please uninstall your existing Rust first.
warning: Otherwise you may have confusion unless you are careful with your PATH
warning: If you are sure that you want both rustup and your already installed Rust
warning: then please reply `y' or `yes' or set RUSTUP_INIT_SKIP_PATH_CHECK to yes

我尝试使用sudo apt remove rustc rustc它返回

Package 'rustc' is not installed, so not removed

虽然我可以从终端访问rustc 我当前的rustccargo版本是 1.47.0。

您可以通过卸载 cargo 然后自动删除其现在不需要的依赖项来手动删除旧的 rust 二进制文件:

sudo apt remove cargo
sudo apt autoremove

完成后,您应该能够正常运行rustup安装脚本:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

请记住,您可能需要重新启动 shell 或注销,然后系统PATH才会更新以包含新的二进制文件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM