LinuxCommandLibrary

rustup

Rust toolchain installer and manager

TLDR

Install Rust toolchain

$ rustup install [stable]
copy
Set default toolchain
$ rustup default [stable]
copy
Update all toolchains
$ rustup update
copy
Show installed toolchains
$ rustup show
copy
Add a component
$ rustup component add [rustfmt]
copy
Add a target for cross-compilation
$ rustup target add [x86_64-unknown-linux-musl]
copy
Run command with specific toolchain
$ rustup run [nightly] [cargo build]
copy
Override toolchain for current directory
$ rustup override set [nightly]
copy
Install nightly
$ rustup install nightly
copy
Uninstall a toolchain
$ rustup uninstall [nightly]
copy

SYNOPSIS

rustup [options] command [args]

DESCRIPTION

rustup is the Rust toolchain installer and version manager. It installs and manages multiple Rust versions (stable, beta, nightly), components (rustfmt, clippy), and cross-compilation targets.
Toolchains are installed per-user in ~/.rustup. Rustup manages the active toolchain, allowing easy switching between versions globally or per-project using rust-toolchain.toml files.
rustup also handles updating Rust, ensuring all installed toolchains stay current with a single command.

PARAMETERS

install toolchain

Install a toolchain.
uninstall toolchain
Remove a toolchain.
update
Update installed toolchains.
default toolchain
Set default toolchain.
show
Show installed toolchains.
run toolchain command
Run command with specific toolchain.
override set toolchain
Set directory-specific override.
override unset
Remove directory override.
component add name
Add component to toolchain.
component list
List available components.
target add target
Add compilation target.
target list
List available targets.
self update
Update rustup itself.
doc
Open Rust documentation.

CONFIGURATION

~/.rustup/

Root directory for all rustup data including installed toolchains, components, and metadata.
rust-toolchain.toml
Per-project file specifying the required Rust toolchain version, components, and targets. Rustup automatically installs the specified toolchain when entering the directory.
RUSTUP_HOME
Environment variable overriding the default rustup installation directory.
RUSTUP_TOOLCHAIN
Environment variable overriding the active toolchain for the current session.

CAVEATS

Nightly may have breaking changes or bugs. Some components not available for all toolchains. Cross-compilation targets may need additional linkers. Disk space usage grows with multiple toolchains.

HISTORY

rustup was developed by Brian Anderson and the Rust team, released in 2016 as the official Rust installer, replacing multirust. It unified Rust installation across platforms and simplified version management. Rustup became the recommended way to install Rust, replacing distribution packages for most developers.

SEE ALSO

rustc(1), cargo(1), rustfmt(1), clippy(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community