Installing Rust on Ubuntu 14.04

Rust, commonly known as Rust, is a systems programming language developed by Mozilla and backed by LLVM. Rust is known for preventing program crashes, memory leaks, and data races before compilation, thereby creating a highly productive and stable programming environment. More recently, Rust released version 1.0.0, which means fewer code updates will be required for developers. This article will show you how to install Rust on Ubuntu 14.04 x64.

System Update

To make sure that all of Rust’s dependencies are up-to-date, run the following commands.

apt-get update
apt-get dist-upgrade -y
apt-get install curl

Install Rust

Installing Rust is a simple process. Run the following command to launch their installation script.

curl -sSf https://static.rust-lang.org/rustup.sh | sh

When the script finishes, Rust will be installed.

Verifying Rust

To verify that Rust was successfully installed, run rustc -V. You will see output similar to:

rustc 1.0.0 (a59de37e9 2015-05-13) (built 2015-05-14)

Using Rust

To use Rust, create a file called main.rs and populate it with the following lines of code:

fn main() {
   println!("You have successfully installed rust!");
}

Now run rustc main.rs. You will see an executable file called main in the same directory. Execute it by running ./main. The text “You have successfully installed Rust!” will appear on your screen.