How to Install Rust on Linux Mint (22, 21)

Last updated Wednesday, March 11, 2026 11:13 am 8 min read 2 comments

When you install Rust on Linux Mint, you add a compiler and package manager that catch memory and concurrency bugs before they turn into runtime failures. That pays off when you are building native CLI tools, backend services, WebAssembly projects, or other low-level software where performance still matters.

rustup is the best fit for most Mint systems because it is the official Linux installer and keeps the current stable toolchain within easy reach. The APT packages are still useful when you want Linux Mint to manage Rust through normal package updates. Either way, you finish with a working compiler, Cargo, editor tooling, and a small project you can build right away.

Install Rust on Linux Mint

Linux Mint gives you two practical ways to install Rust. rustup uses the official installer and keeps stable, beta, and nightly toolchains close at hand. The repository method uses Mint’s own packages, which trade newer releases for tighter APT integration.

MethodChannelVersionUpdatesBest For
rustup (Recommended)rustup.rsCurrent stable, beta, or nightlyManual with rustup updateActive development, fast updates, and switching toolchains per project
APT RepositoryLinux Mint repositoriesMint-packaged stable branchSystem updates or sudo apt install --only-upgrade rustc cargoSystem-managed packages and simpler APT-based maintenance

rustup is the better starting point for most development work. During validation on Linux Mint 22.3 and 21.3, rustup installed Rust 1.94.0, while the default APT packages stayed on the older 1.75.x branch.

Install Rust with rustup on Linux Mint

Use rustup when you want the official Linux installer, quick updates, and the option to add nightly or beta toolchains later without replacing Mint packages by hand.

Start by refreshing package metadata:

sudo apt update

If your account still needs administrative access, create and add users to sudoers on Linux Mint before continuing.

Next, install the packages rustup and many native crates rely on. On a typical Mint desktop, the curl command is often already there, but install GCC on Linux Mint and add pkg-config support before you start compiling crates that depend on system libraries.

sudo apt install curl build-essential pkg-config

build-essential provides the C compiler and linker toolchain many crates still need under the hood. pkg-config helps those builds find installed libraries such as OpenSSL, SQLite, or GTK.

Run the official installer next:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

The --proto and --tlsv1.2 checks keep the download on HTTPS. The sh -s -- -y portion passes -y to the installer so it accepts the standard install without waiting for an interactive menu.

Load Rust into the current shell so you can use it right away:

source "$HOME/.cargo/env"

During validation, rustup added the same . "$HOME/.cargo/env" line to both ~/.profile and ~/.bashrc, so new terminal sessions picked Rust up automatically after installation.

Verify the rustup installation:

rustc --version && cargo --version
rustc 1.94.0 (4a4ef493e 2026-03-02)
cargo 1.94.0 (85eff7c80 2026-01-15)

Install Rust from Linux Mint repositories

Choose the APT method when you want Mint to manage Rust with ordinary package updates and you do not need the newest compiler branch on day one.

sudo apt install rustc cargo

Check the versions Mint installed:

rustc --version && cargo --version
rustc 1.75.0 (82e1608df 2023-12-21) (built from a source tarball)
cargo 1.75.0

On current Mint 22.3 and 21.3 systems, the repository channel resolves to the 1.75.x branch. That is stable enough for many packaged workloads, but it trails rustup by several releases.

Build a Test Rust Project on Linux Mint

A quick project build proves more than a version check because it exercises Cargo, the compiler, and the local linker in one pass.

cargo new hello-rust && cd hello-rust

When Git is already installed, Cargo also initializes a repository for the new project. If you still need that toolchain, install Git on Linux Mint before you start versioning your Rust work.

Compile and run the sample project:

cargo run --quiet
Hello, world!

If you want Cargo to show the compile steps as well, run the same command without --quiet. Use cargo run --release when you want an optimized build instead of the default developer profile.

Add Rust Development Tools on Linux Mint

The default rustup profile already installs Cargo, Clippy, rustc, and rustfmt. Add rust-analyzer if you want autocomplete, inline diagnostics, and jump-to-definition support in editors such as install VS Code on Linux Mint.

rustup component add rust-analyzer

Check the installed toolchain components:

rustup component list --installed
cargo-x86_64-unknown-linux-gnu
clippy-x86_64-unknown-linux-gnu
rust-analyzer-x86_64-unknown-linux-gnu
rust-docs-x86_64-unknown-linux-gnu
rust-std-x86_64-unknown-linux-gnu
rustc-x86_64-unknown-linux-gnu
rustfmt-x86_64-unknown-linux-gnu

Three everyday commands are worth using early: cargo fmt formats the crate, cargo clippy flags common mistakes and style issues, and cargo test runs the test suite defined in your project.

Manage Rust Updates and Toolchains on Linux Mint

Rust maintenance depends on how you installed it, so use the matching update path instead of mixing rustup and APT commands.

Update Rust installed with rustup on Linux Mint

rustup updates every installed toolchain in one pass:

rustup update
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: checking for self-update
info: cleaning up downloads & tmp directories

  stable-x86_64-unknown-linux-gnu unchanged - rustc 1.94.0 (4a4ef493e 2026-03-02)

Update Rust installed with APT on Linux Mint

If you chose the repository packages, let Mint handle routine upgrades through normal system maintenance or upgrade only Rust and Cargo when you want a narrower change set:

sudo apt install --only-upgrade rustc cargo

Run rustc --version afterwards if you want to confirm that Mint moved you to a newer packaged branch.

Install a Nightly Rust Toolchain on Linux Mint

The nightly toolchain is useful when a crate depends on unstable features or you want to test the next compiler line without replacing stable:

rustup toolchain install nightly

List the toolchains now available on your system:

rustup toolchain list
stable-x86_64-unknown-linux-gnu (active, default)
nightly-x86_64-unknown-linux-gnu

Add a Rust Cross-Compilation Target on Linux Mint

Cross targets let one Mint machine build binaries for another platform or runtime. WebAssembly is a common first example:

rustup target add wasm32-unknown-unknown

Build for that target later with cargo build --target wasm32-unknown-unknown.

Fix Common Rust Issues on Linux Mint

Most install problems come down to shell PATH loading or mixing the Mint packages with rustup. These checks keep the diagnosis short.

Fix Rust command not found on Linux Mint

If your current shell prints an error such as bash: rustup: command not found, bash: rustc: command not found, or bash: cargo: command not found right after installation, the profile change has not been loaded into that session yet.

source "$HOME/.cargo/env"

Verify that the shell can now use the toolchain:

rustup --version && rustc --version && cargo --version
rustup 1.28.2 (e4f3ad6f8 2025-04-28)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.94.0 (4a4ef493e 2026-03-02)`
rustc 1.94.0 (4a4ef493e 2026-03-02)
cargo 1.94.0 (85eff7c80 2026-01-15)

Fix APT and rustup version conflicts on Linux Mint

When both installation methods are present, rustup can report an active stable toolchain while Mint still runs the older /usr/bin/rustc binary from APT.

Compare the compiler version with the rustup toolchain status:

rustc --version && rustup show active-toolchain
rustc 1.94.0 (4a4ef493e 2026-03-02)
stable-x86_64-unknown-linux-gnu (default)

If rustc --version still reports 1.75.0 while rustup shows a newer stable toolchain, remove the APT packages and reload the shell environment:

sudo apt remove rustc cargo && source "$HOME/.cargo/env"

Remove Rust from Linux Mint

Use the removal command that matches the method you installed. rustup and APT manage different files, so one command does not clean up the other.

Remove Rust installed with rustup on Linux Mint

This command removes the rustup-managed toolchains, the Cargo home, and the shell startup lines rustup added. The -y flag skips the confirmation prompt.

rustup self uninstall -y
info: removing rustup home
info: removing cargo home
info: removing rustup binaries
info: rustup is uninstalled

During validation, rustup removed the . "$HOME/.cargo/env" lines from both ~/.profile and ~/.bashrc. It does not remove your project directories, so crates like hello-rust remain in place.

Remove Rust installed from Linux Mint repositories

APT users can remove the compiler and package manager with the standard package command:

sudo apt remove rustc cargo

Confirm that Mint no longer sees those packages as installed:

apt-cache policy rustc cargo
rustc:
  Installed: (none)
  Candidate: 1.75.0+dfsg0ubuntu1-0ubuntu7.1
  Version table:
     1.75.0+dfsg0ubuntu1-0ubuntu7.1 500
        500 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages
     1.75.0+dfsg0ubuntu1-0ubuntu7 500
        500 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages
cargo:
  Installed: (none)
  Candidate: 1.75.0+dfsg0ubuntu1-0ubuntu7.1
  Version table:
     1.75.0+dfsg0ubuntu1-0ubuntu7.1 500
        500 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages

On Mint 21.x, the same verification block still shows Installed: (none), but the repository lines point to jammy packages instead of noble.

If APT reports additional libraries are no longer required, remove them with sudo apt autoremove only when you know nothing else on the system depends on them.

Frequently Asked Questions About Rust on Linux Mint

Should you use rustup or APT to install Rust on Linux Mint?

Use rustup when you want the official Rust installer, quicker updates, and easy access to stable, beta, or nightly toolchains. Use APT when you prefer Linux Mint to manage Rust through normal package updates. During validation on Mint 22.3 and 21.3, rustup installed Rust 1.94.0 while APT provided the older 1.75.x branch.

Does rustup install Cargo on Linux Mint?

Yes. A default rustup install gives you cargo, rustc, clippy, and rustfmt in one step. rust-analyzer still needs a separate rustup component add rust-analyzer command if you want editor integration.

Is there an official Rust download for Linux Mint?

Yes. The official Linux installer is rustup from rustup.rs, which uses the sh.rustup.rs installer script. There is no Mint-specific .deb from the Rust project, so use rustup for the upstream install path or APT when you want Mint-managed packages instead.

Can you keep the APT Rust packages and rustup together on Linux Mint?

You can, but most users should not. The shell may keep using Mint’s older /usr/bin/rustc even after rustup installs a newer toolchain in ~/.cargo/bin. Pick one method unless you have a clear reason to keep both, and verify the active compiler with rustc --version plus rustup show active-toolchain.

Next Steps With Rust on Linux Mint

With Rust installed on Linux Mint, you have a working compiler, Cargo, and a verified build path whether you chose rustup or Mint’s APT packages. If you want a fuller editor setup, install VS Code on Linux Mint or install Git on Linux Mint, then keep the Rust Book nearby as you move from simple crates to larger projects.

Search LinuxCapable

Need another guide?

Search LinuxCapable for package installs, commands, troubleshooting, and follow-up guides related to what you just read.

Found this guide useful?

Support LinuxCapable to keep tutorials free and up to date.

Buy me a coffee Buy me a coffee

2 thoughts on “How to Install Rust on Linux Mint (22, 21)”

  1. Clear ans simple instructions. Worked as expected.
    The instructions align with those on the rust website, but with some Linux Mint specific additions, like making sure that prerequisites like gcc, make, curl and make are installed.

    If you are a programmer, you may have these installed already but it’s nice to have them in the instructions. This is particularly true because this install rust outside the normal apt process for installing on debian/ubuntu.

    After installing, I recommend a book like ‘Programming Rust’ by Blandy & Orendorff from O’Reilly publishing. There are plenty of tutorials online and at various training sites.

    Reply
Before commenting, please review our Comments Policy.
Formatting tips for your comment

You can use basic HTML to format your comment. Useful tags currently allowed:

You type Result
<code>command</code> command
<strong>bold</strong> bold
<em>italic</em> italic
<blockquote>quote</blockquote> quote block

Leave a Comment

We read and reply to every comment - let us know how we can help or improve this guide.

Let us know you are human: