How to install RUST Programming Language on Ubuntu 20.04

Posted on September 22nd, 2022

RUST is a programming language that is easy to understand and ensures applications are secured. It compiles the code in no time and is powerful. In this tutorial, we are going to learn how you can install RUST on your ubuntu operating system. 

We can use many programming languages like C, C++, Java, and Python to write code and build something, but out of many such programming languages, RUST has caught my attention. 

RUST was developed in 2006 by software developer Gradon Hoare as his hobby. Eventually, they released the first version of this programming language in 2010.

All the commands for Installing and configuring RUST on your ubuntu machine are provided below with their respective screenshots. Make sure you execute each command without fail and successfully install RUST on the ubuntu machine.

Note – Although this tutorial is for installing RUST on Ubuntu 20.04 LTS version, we can also follow this same tutorial for other ubuntu versions.

Commands To Install RUST Programming Language On Ubuntu

First of all we will update our current OS with latest available updates. Execute the following command on your server. It will download and install the latest updates for each outdated package and its dependencies on your ubuntu operating system. We will also install other essential packages on the server – the second command.

$ sudo apt update && sudo apt upgrade -y
$ sudo apt install curl build-essential gcc make -y

Without GCC, the RUST won’t be able to function properly. So, having this compiler is mandatory on your host operating system. Execute the following command to download and execute the RUST installer.

$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

After executing the above command, it will ask you to choose from the three options.

  1. Proceed with installation (default) 
  2. Customize installation 
  3. Cancel installation

Type 1 from the keyboard and press ENTER to proceed further in the installation. It will take some time to install it on your Ubuntu OS. Once done, execute the following commands to complete the installation.

Now, Execute the following commands to enable the RUST environment for our Ubuntu’s shell.

$ source ~/.profile
$ source ~/.cargo/env

Once everything is set up properly, execute the following two commands to see the gcc compiler version and rust version. If you can successfully execute the commands and see the output, installation is successful.

$ gcc –version
$ rustc -V

Installing RUST on Ubuntu 20.04 is completed, and now you can create your first RUST program directly.

Frequently Asked Questions – FAQs

1. Which Language Is RUST Written In?

There is no particular answer to this. However, many experts say that RUST was initially built on C and C++ programming languages, and the LLVM compiler was considered for processing the written code. 

Now, many other compilers and languages are used for the latest versions to make RUST a fast and secure programming language. 

2. Is RUST A Good Beginner Language?

RUST is a difficult language compared to C, C++, Python and other programming languages. But in terms of security, RUST is considered to be the best. I suggest learning python or C language first if you are a beginner.

3. How To Uninstall RUST from Ubuntu?

To uninstall RUST from your ubuntu operating system, use the following command.

$ rustup self uninstall

This command will uninstall the files and packages which were downloaded while installation.

4. How To Check The RUST Version In Ubuntu?

To check which version of RUST programming language you have installed on your ubuntu Linux, use the following command.

$ rustc -V

5. What Language Is Rust Similar To?

We can compare RUST with C and C++, but each language is unique and created for a specific purpose. RUST is hard to learn because of its complex syntax and concepts. But this programming language provides more security and faster code compilation than other languages.

6. How To Update RUST on Ubuntu?

If RUST is already installed on your ubuntu, but you want to upgrade it to the latest version, then execute the following command.

$ rustup update

It will download the latest packages of RUST and will update the respective repositories.

Conclusion

In this tutorial, you have learned how to install RUST on Ubuntu 20.04 | 22.04 | 16.04 | 18.04 operating systems. Commands, along with the screenshots, were provided for installation and reference. 

Also, we learned how to install the GCC compiler and activated the RUST environment on ubuntu. I hope that you were able to install RUST on your Ubuntu machine. 

If you face any errors or cannot install RUST, please mention the error in the comment section below. Thank You for reading the blog.

Leave a Reply