doc/user-guide/src/installation/other.md
The primary installation method, as described at https://rustup.rs, differs by platform:
rustup-init.exe built for the
x86_64-pc-windows-msvc or aarch64-pc-windows-msvc target,
depending on your OS architecture. In general, this is the build of
rustup one should install on Windows. This will require MSVC prerequisites.
If you would prefer to install GNU toolchains or the i686
toolchains by default this can be modified at install time, either
interactively, with the --default-host flag, or after installation
via rustup set default-host.curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh in your shell. This
downloads and runs rustup-init.sh, which in turn downloads and runs the
correct version of the rustup-init executable for your platform.rustup-init accepts arguments, which can be passed through the shell script.
Some examples:
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --help
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain nightly
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --profile minimal --default-toolchain nightly
Please note that the rustup project is not maintaining any package mentioned in this section. If you have encountered any problems installing
rustupwith a package manager, please contact the package maintainer(s) for further information.
Different package managers take slightly different approaches towards managing rustup. After installing rustup with your favorite package manager, there are usually two possibilities:
If your package manager has made the rustup command available
together with proxies for Rust tools such as rustc and cargo,
picking a default toolchain (e.g. stable) would usually be enough:
$ rustup default stable
As of 2024/12/23, this is the case for APT, homebrew and pacman.
If your package manager has only made the rustup-init command available, simply run:
$ rustup-init
This will allow you to perform the initial setup of rustup, populate all the proxies
managed by rustup, and install a default toolchain.
As of 2024/12/23, this is the case for DNF.
When the installation is completed, please make sure that the rustup proxies
(usually under $HOME/.cargo/bin) are correctly exposed via your $PATH,
and you should be able to run rustup, rustc, cargo, etc. normally.
Starting from Debian 13 (trixie) and Ubuntu 24.04 (noble),
you may use apt to install rustup:
$ sudo apt install rustup
You can use brew to install rustup1:
$ brew install rustup
Please note that Rust tools like rustc and cargo are not available via $PATH by default
in this rustup distribution
(see homebrew-core#177582 for more details).
You might want to add $(brew --prefix rustup)/bin to $PATH to make them easier to access.
You can manually download rustup-init for a given target from
https://static.rust-lang.org/rustup/dist/{target-triple}/rustup-init[.exe]2 3.
To get a previous version, use
https://static.rust-lang.org/rustup/archive/{rustup-version}/{target-triple}/rustup-init[.exe].
SHA-256 checksums are also available by appending .sha256 to the link.
To install rustup from source, check out the git repository from
https://github.com/rust-lang/rustup and run cargo run --release. Note that
after installation the rustup toolchains will supersede any pre-existing
toolchains by prepending ~/.cargo/bin to the PATH environment variable.
This is not to be confused with the rust package,
which is a brew-managed rust toolchain installation. ↩
Windows GNU builds require no additional software for basic use. However, many library crates will not be able to compile until the full MSYS2 with MinGW has been installed. ↩ ↩2 ↩3
MSVC builds of rustup additionally require an installation of
Visual Studio 2019 or the Visual C++ Build Tools 2019. For Visual
Studio, make sure to check the "C++ tools" and "Windows 10 SDK" option. ↩ ↩2 ↩3