Installing Rust on Ubuntu 24.04.3 — The Complete Guide
en / languages / rust — 2025-10-17 00:00:00
🦀 Installing Rust on Ubuntu 24.04.3
Rust is a fast, memory-safe systems programming language that’s ideal for both performance-critical and modern application development.
In this guide, we’ll go through the complete process of installing Rust on Ubuntu 24.04.3, step-by-step — from setup to verification.
🧰 Prerequisites
Before installing Rust, make sure your system is up to date and has the basic tools required for compilation.
```bash sudo apt update && sudo apt upgrade -y sudo apt install build-essential curl -y
This ensures you have gcc, make, and curl available — all needed by the Rust toolchain.
⚙️ Step 1: Install Rustup (the official installer)
Rust uses a tool called rustup to manage versions and toolchains.
Run the following command in your terminal:
curl https://sh.rustup.rs -sSf | sh
You will see an interactive installer like this:
1) Proceed with installation (default) 2) Customize installation 3) Cancel installation
Press 1 and hit Enter to proceed with the default installation. Rustup will automatically download and configure the stable Rust toolchain.
🧩 Step 2: Configure Your Environment
After installation completes, load the Rust environment variables:
source $HOME/.cargo/env
To make this permanent, add the same line to your .bashrc or .zshrc:
echo 'source $HOME/.cargo/env' >> ~/.bashrc
Then reload your shell:
source ~/.bashrc
🧠 Step 3: Verify the Installation
Check the installed version of Rust and Cargo:
rustc 1.84.0 (stable) cargo 1.84.0
Congratulations — Rust is now fully installed on your Ubuntu system!
🧪 Step 4: Test Your Installation
Let’s create and run your first Rust project:
cargo new hello-rust cd hello-rust cargo run
You should see:
Compiling hello-rust v0.1.0 (/home/maciej/hello-rust)
Finished dev [unoptimized + debuginfo] target(s) in 0.33s
Running target/debug/hello-rust
Hello, world!
✅ Your Rust toolchain, compiler, and build system are all working perfectly.
🧭 Step 5: Keeping Rust Updated
Rust evolves rapidly — to keep your toolchain up to date, run:
rustup update
This will fetch the latest stable version of Rust, Cargo, and documentation.
You can also check your currently installed toolchains:
rustup toolchain list
🧱 Optional: Install Additional Components
Rust includes several helpful tools you can install via rustup:
rustup component add rustfmt rustup component add clippy
rustfmt — automatically formats your code
clippy — provides advanced lints and suggestions for cleaner Rust code
🧠 Troubleshooting
If you encounter issues, check the following:
Make sure $HOME/.cargo/bin is in your $PATH:
echo $PATH
Try reloading your shell or re-sourcing the environment.
If all else fails, uninstall and reinstall Rust with:
rustup self uninstall
🚀 Summary Step Action 1 Update system and install build tools 2 Install Rust via rustup 3 Load environment (source $HOME/.cargo/env) 4 Verify with rustc --version 5 Test with cargo new hello-rust
You’re now ready to start writing modern, safe, and blazing-fast code with Rust on Ubuntu!
Resources
Official Rust Installation Guide
Rustup Documentation
The Cargo Book