簡體   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