Languages

Install Rust

Rust and Cargo through rustup, the official installer that also keeps them up to date.

  1. Install rustup
    Terminal
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

    Press Enter to accept the default install.

  2. Load Cargo into this terminal
    Terminal
    source "$HOME/.cargo/env"
  3. Start a project
    Terminal
    cargo new hello && cd hello && cargo run

Check it worked

  1. Check the versions
    Terminal
    rustc --version && cargo --version
Undo it
  1. Uninstall Rust
    Terminal
    rustup self uninstall
  1. Install rustup
    Terminal · Ubuntu / Debian
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

    Rust needs a linker. Install the build tools first if you haven't.

  2. Load Cargo into this terminal
    Terminal · Ubuntu / Debian
    source "$HOME/.cargo/env"
  3. Start a project
    Terminal · Ubuntu / Debian
    cargo new hello && cd hello && cargo run

Check it worked

  1. Check the versions
    Terminal · Ubuntu / Debian
    rustc --version && cargo --version
Undo it
  1. Uninstall Rust
    Terminal · Ubuntu / Debian
    rustup self uninstall
  1. Install rustup
    PowerShell
    winget install Rustlang.Rustup

    Rust on Windows needs the Visual Studio C++ build tools. Install them first, then close and reopen PowerShell.

  2. Start a project
    PowerShell
    cargo new hello; cd hello; cargo run

Check it worked

  1. Check the versions
    PowerShell
    rustc --version; cargo --version
Undo it
  1. Uninstall Rust
    PowerShell
    rustup self uninstall