CEOWORLD magazine - Latest - Executive Education - How To Install The Rust Programming Language On Linux

Executive Education

How To Install The Rust Programming Language On Linux

Rust was developed by Mozilla, originally released on July 7, 2010, and designed for highly concurrent and safe systems. The syntax of Rust is similar to C and C++, with blocks of code delimited by curly braces ({}). The emphasis of Rust is safety, control of memory layout, and concurrency.

Rust is currently being employed by companies like Dropbox, Sentry, Postmates, Brilliant, Tonsser Stac, Wantedly, Klarna, Doctolib, QIWI, and software development companies like BairesDev. Rust seamlessly integrates with tools like Google Code, Ethereum, Iron, Ripple, Leaf, Tokamak, Pencil, and Airbrake.

The Rust language supports zero-cost abstractions, threads without data races, trait-based generics, and pattern matching. It’s also fast, has a minimal runtime, supports algebraic data types, includes efficient C bindings, and is open source. Those new to Rust will need to install the programing language on a supported platform.

Although there are a number of operating systems Rust can be used on, chances are you’ll be developing with Rust on Linux, especially for web-based applications and services. So let’s walk through the process of installing Rust on Linux. I’ll show you how to install this programming language on Debian/Ubuntu and CentOS/RHEL. Once installed, you can start your development journey to create world-class applications and services.

What You’ll Need

The only things you’ll need to get Rust installed are:

  • A running Linux distribution.
  • A user with sudo privileges.
  • A network connection.

That’s it. Let’s install it.


Before we jump into the installation of Rust, let’s update and upgrade our system. Just remember that if the kernel gets upgraded, you’ll need to reboot the machine. Because of this, make sure to run the update/upgrade process at a time when a reboot is possible.

Once you have the time set, you can upgrade the different distributions like so.

Debian/Ubuntu with the commands:

sudo apt-get update

sudo apt-get upgrade -y

CentOS/RHEL with the command:

sudo dnf update -y

If required, reboot and log back into your machine.

Installing Rust

Now, we can install Rust. In order to do so, we must first install the curl application. This can be done on the various distributions with the following commands.


sudo apt-get install curl -y


sudo dnf install curl -y

With curl installed, download and run the Rust installation script with the command:

curl -sSf | sh

Once the installer has downloaded it will automatically run and ask you if you want to proceed, customize, or cancel the installation (Figure 1).

Figure 1

Proceeding with the installation.

Type 1 to proceed with the installation. During the process, rustup will attempt to add Cargo’s bin directory to your $PATH. Chances are it will fail, so you’ll have to do it manually. To add the Cargo bin directory to your $PATH, issue the command:

source $HOME/.cargo/env

You also need to source ~/.profile to use the modified $PATH and ensure your shell will work with the rust environment. Do this with the command:

source ~/.profile

Once you’ve taken care of that, log out and log back into your machine and verify the rust installation by issuing the command:

rustc –version

You should see the version of Rust printed in the output (Figure 2).

Figure 2

Rust has been successfully installed.

Finally, you’ll need to install the required dependencies for the rustc command. Here’s how you do that on the various distributions.


sudo apt-get install build-essential -y


sudo dnf install cmake gcc -y

Testing Rust

If you’re an application development company, it’s not enough to just install the programming language. You need to test the Rust installation by creating a simple program. We’ll create the tried and true “Hello, World!” application.

First, create a new directory for the program with the command:

mkdir rusttest

Change into that new directory with the command:

cd rusttest

Create a new file with the command:


Paste the following into that file:

fn main() {

println!(“Hello, World!”);


Create the Rust executable with the command:


You will not see any output from the above command. You should, however, see a new executable application in the rusttest directory, called rusttest. To run that executable application, issue the command:


When you execute the application, Hello, World! should print out on your screen (Figure 3).

Figure 3

A successful test of Rust.

And that’s all there is to installing Rust and creating your first program. Congratulations, your journey is just beginning. You’ll soon be creating powerful and helpful applications used by your company or end-users around the globe.

Have you read?

World’s Happiest Countries.
Countries With The Highest Life Expectancy.
World’s Most (And Least) Religious Countries.
World’s Best Countries For Investment In Travel And Tourism Sector.

Add CEOWORLD magazine to your Google News feed.
Follow CEOWORLD magazine headlines on: Google News, LinkedIn, Twitter, and Facebook.
Thank you for supporting our journalism. Subscribe here.
For media queries, please contact:
CEOWORLD magazine - Latest - Executive Education - How To Install The Rust Programming Language On Linux
Ryan Miller
Ryan Miller is CEOWORLD magazine's executive editor of news, writing analysis, and long-form reporting. In his role, he coordinates and tracks the publication of special packages, magazine stories, and the publication’s signature lists. He's a somewhat long-suffering supporter of Manchester United F.C. and a genuinely long-suffering fan of the Los Angeles Clippers.