How To Install Rustc On Debian, Ubuntu, Alpine, Arch, Kali, Fedora, Raspbian And MacOS?

How To Install Rustc On Debian, Ubuntu, Alpine, Arch, Kali, Fedora, Raspbian And MacOS?

rustc

The Rust compiler.
Processes, compiles and links Rust language source files.

Maintainer: Debian Rust Maintainers



Section: rust

Install rustc

  • Debian apt-get install rustc Click to copy
  • Ubuntu apt-get install rustc Click to copy
  • Alpine OS apk add rust Click to copy
  • Arch Linux pacman -S rust Click to copy
  • Kali Linux apt-get install rustc Click to copy
  • Fedora dnf install rust Click to copy
  • Raspbian apt-get install rustc Click to copy
  • macOS brew install rust Click to copy

The Rust compiler. Processes, compiles and links Rust language source files.

How to use rustc?

Below are few example commands for rustc that you can use in the terminal.

Compile a single file:
rustc file.rsClick to copy
Compile with high optimization:
rustc -O file.rsClick to copy
Compile with debugging information:
rustc -g file.rsClick to copy
To install the latest version of rustc in your favorite operating system just copy the rustc installation command from above and paste it into terminal. It will download and install the latest version of rustc 2026 package in your OS.