How to Install Rust on Ubuntu 26.10
Rust is a multi-paradigm, general-purpose programming language that emphasizes performance, type safety, and concurrency. It enforces memory safety by ensuring that references point to valid memory without requiring a garbage collector or reference counting.
Install Rust
Install Rust using the rustup command-line tool.
Run the following command to download and start the installer:
curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh
You'll see output similar to:
Welcome to Rust!
This will download and install the official compiler for the Rust programming language, and its package manager, Cargo.
Rustup metadata and toolchains will be installed into the Rustup home directory, located at:
/root/.rustup
The Cargo home directory is located at:
/root/.cargo
The cargo, rustc, rustup and other commands will be added to Cargo's bin directory:
/root/.cargo/bin
This path will then be added to your PATH environment variable by modifying:
/root/.profile
/root/.bashrc
You can uninstall at any time with rustup self uninstall.
Current installation options:
1) Proceed with standard installation (default - just press enter)
2) Customize installation
3) Cancel installation
Choose option 1 to proceed with the standard installation.
>1
Once the installation completes, you'll see output similar to:
info: default toolchain set to stable-x86_64-unknown-linux-gnu
stable-x86_64-unknown-linux-gnu installed - rustc 1.95.0 (59807616e 2026-04-14)
Rust is installed now. Great!
To get started, you may need to restart your current shell.
Add Rust to your PATH:
source "$HOME/.cargo/env"
Verify the Installation
Check the installed Rust version:
rustc --version
Output:
rustc 1.99.1 (58cf8f9c3 2026-10-13)
Installing a Compiler and Build Tools
Update the package index and upgrade installed packages:
apt update && apt upgrade -y
Install the required development tools:
apt install build-essential -y
Creating, Compiling, and Running a Test Program
Create a project directory:
mkdir -p ~/rustprojects/testdir
cd ~/rustprojects/testdir
Create a file named test.rs:
nano test.rs
Paste the following code:
fn main() {
println!("Congratulations! You have installed your Rust program and it works.");
}
Save and close the file. Then compile it:
rustc test.rs
Run the program:
./test
Output:
Congratulations! You have installed your Rust program and it works.
Updating Rust
To update Rust in the future, run:
rustup update
Output:
root@vps:~/rustprojects/testdir# rustup update
stable-x86_64-unknown-linux-gnu unchanged - rustc 1.99.1 (58cf8f9c3 2026-10-13)
info: checking for self-update (current version: 1.29.2)
info: cleaning up downloads & tmp directories
You have successfully installed and tested Rust on Ubuntu 26.10.
CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!
1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month
Available Locations: LAX | MIA | ATL | FRA | AMS