以下是在Debian下搭建Rust開發環境的步驟:
sudo apt update
。sudo apt install curl build-essential gcc make
。curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
,安裝過程中可按提示選擇默認選項。sudo apt install rustc cargo
,但此方法安裝的Rust版本可能不是最新的。source $HOME/.cargo/env
。export PATH="$HOME/.cargo/bin:$PATH"
到~/.bashrc
或~/.zshrc
并重新加載。rustc --version
和cargo --version
,顯示版本信息則安裝成功。此外,還可根據需要安裝額外工具,如cargo-deb
用于創建Debian包,以及在VSCode等IDE中安裝Rust插件以提升開發體驗。