$linuxjunkies
>

rustup(1)

rustup is the Rust toolchain installer and version manager for managing multiple Rust versions and targets.

UbuntuDebianFedoraArch

Synopsis

rustup [COMMAND] [OPTIONS]

Description

rustup is the official tool for installing and managing Rust compiler versions, targets, and components. It handles downloading, installing, and switching between stable, beta, and nightly Rust releases, as well as managing cross-compilation targets and additional tools.

rustup maintains multiple toolchains (compiler versions) simultaneously and allows you to set a default toolchain globally or override it per-project using a rust-toolchain.toml file. It also installs and manages rustup itself through automatic self-updates.

Common options

FlagWhat it does
default <toolchain>Set the default Rust toolchain (e.g., stable, nightly, 1.70.0)
install <toolchain>Install a specific Rust toolchain version or channel
uninstall <toolchain>Remove a toolchain and its associated binaries
updateUpdate all installed toolchains and rustup itself to latest versions
target listList all available cross-compilation targets
target add <target>Install a cross-compilation target (e.g., wasm32-unknown-unknown)
component listList available components (rustfmt, clippy, rust-src, etc.)
component add <component>Install an additional component like rustfmt or clippy
showDisplay the currently active toolchain and target information
toolchain listList all installed toolchains
-v, --verboseEnable verbose output for debugging
--no-self-updateDisable automatic rustup self-updates

Examples

Set the stable Rust release as your default toolchain

rustup default stable

Install the latest nightly Rust compiler

rustup install nightly

Update all installed toolchains and rustup to the latest versions

rustup update

Add WebAssembly compilation target to the current toolchain

rustup target add wasm32-unknown-unknown

Install rustfmt code formatter component

rustup component add rustfmt

Display the active toolchain and currently selected targets

rustup show

List all installed Rust toolchains with the active one marked

rustup toolchain list

Use nightly Rust specifically for a particular project directory

rustup override set nightly --path /path/to/project

Related commands