Installing Rust with rustup
Installing Rust with rustup
The primary and official method for installing and managing Rust toolchains across all platforms is rustup.
Installing rustup
On Linux and macOS, install rustup via your terminal:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shFollow the default prompts. This installs: - rustc: The Rust compiler. - cargo: The package manager and build system. - rustup: The toolchain multiplexer. - rust-std: Standard library binaries for your host architecture.
Managing Toolchains
Configure your shell environment:
source "$HOME/.cargo/env"
rustc --version
cargo --versionTo update your toolchain to the latest stable release:
rustup update stable