Installing Rust On Ubuntu 16.04 and 14.04
Rust, also known as Rust-Lang, is a new programming language which aims safety, speed and concurrency... It's designed to create highly concurrent and secure Applications/Systems by having more a number of compile-time safety checks that produce no runtime overhead, while eliminating all data races.... According to documentation, Rust also aims to achieve ‘zero-cost abstractions’ even though some of these abstractions feel like those of a high-level language.
Here.. We are going to see how to install and getting start with rust on Ubuntu Linux 16.04 & 14.04
Step 1: Update Source(Package) List
Open terminal and run the following commands to ensure that package source list is upto date and also install curl...
For Ubuntu 16.04
sudo apt update && sudo apt -y install curl
For Ubuntu 14.04
sudo apt-get update && sudo apt-get -y install curl
Step 2: Install Rust
Now run the following command which download and runs a script that will install rust on your Linux box..
wget -O - https://static.rust-lang.org/rustup.sh | sh
Or If you have curl installed..
curl -sSf https://static.rust-lang.org/rustup.sh | sh
Rust packages are available in three different release channels namely stable, beta and nightly... The above command will install current stable version of rust on your system..
If you want to install beta version(A preview of the upcoming stable release, intended for testing) of rust, run the following command..
wget -O - https://static.rust-lang.org/rustup.sh | sh -s -- --channel=beta
Or
curl -sSf https://static.rust-lang.org/rustup.sh | sh -s -- --channel=beta
If you want to enjoy features that are not available in stable and beta channels, install rust from nightly release channel.. (Be aware, Features which are available in nightly channel are unstable may change anytime before they get into beta channel)
wget -O - https://static.rust-lang.org/rustup.sh | sh -s -- --channel=nightly
Or
curl -sSf https://static.rust-lang.org/rustup.sh | sh -s -- --channel=nightly
Step 3: Verify The Installation
You can verify the successful installation of rust in your System by running
Get start with rust..
If you see output similar to above.. that means your installation was successful.. So now here i am going to show how to write a hello world program in rust and run it..
Create file named
fn main() {
println!("Hello, World");
}
Now compile it with
Here, You Can Learn Rust Programming..
Here is the video for above tutorial...
Happy Coding !!