Step to Install Rust Programming Language on Ubuntu 20.04 LTS

Rust is a free & open source Programming language tool. It is used to create fast and secure applications & supports zero-cost abstractions, threads without data races, move semantics, minimal runtime, and pattern matching.

There are some steps to install Rust on Ubuntu:

Step 1: Update the System.

apt-get update

Step 2: Install Rust on System.

apt install rustc

  • Here is the command output.

  • Check Rust version.

rustc --version

  • Here is the command output.

Step 3: Example of Rust Programming Language.

  • Create a directory & Navigate into it.

mkdir project
cd project

  • Create a file.

vim example.rs

  • Add the following line:

fn main() {
println!("Hello, world!");
}

  • Compile the code.

rustc example.rs

  • Run the code.

./example

  • Here is the output.

Leave a Reply