How to install Rust Programming language on Ubuntu 20.04 / Debian 10?

Windows Articles

How to install KVM on Debian 10?

Hello friends, in this post I will show you how to install KVM on Debian 10. KVM stands for...

How to open Windows 10 Mobility Center

Hello! There are many types of users of Windows 10. As it depends on the type of hardware used. That is, the...

Ubuntu 20.04.1 available

Canonical, the company led by Mark Shuttleworth, releases Ubuntu 20.04.1. It has a new image, with updates and security patches for the...

How to install Linux Kernel 5.8 on Ubuntu 20.04?

Upgrading the Linux Kernel can be a beneficial task, but it is always optional. Recently we talked about the Linux Kernel 5.8...

How to activate XPS Viewer in Windows 10

Hey, what's up! When working with Windows 10 we probably use a lot of files. Indeed, these files have many extensions. For...
angeloma
angeloma
Senior Writer and partner

Learning programming languages is a good option to find a good job. Above all, if you dedicate yourself to this. Because for no one is a secret that we live in times where many applications are used. That’s why this post will teach you how to install Rust on Ubuntu 20.04 / Debian 10.

Rust is an open source, multipurpose and new programming language that aims to retire to the C language. Although it is sponsored by Mozilla and Samsung, it is a community project. Its focus is primarily on large programs that run on the client and server side.

The main characteristics of Rust are performance, reliability, and productivity. Rust can compile and create applications very quickly; it is conducive to very few failures and its large documentation makes it possible to learn quickly.

Install Rust on Ubuntu 20.04 / Debian 10

Installing Rust is easy thanks to rustup. In fact, it is the recommended way to install Rust, as there are other ways to do it. All you have to do is run the following command.

:~$ curl https://sh.rustup.rs -sSf | sh

1.- Download the Rust installation script
1.- Download the Rust installation script

Note: If you don’t have curl installed, you can do it from the terminal. For example, in Ubuntu and Debian a sudo apt install curl is sufficient.

In the installer, you will be asked if you want to keep the default values in the installation or if you want to customize them. Choose option 1 to use the default values and avoid further complications.

2.- Running the installation script
2.- install Rust

After the installation is complete, it is necessary to refresh the Shell profile. Because during the process the compiler and other things are installed.

3.- Rust is installed
3.- Rust is installed

Just run:

:~$ source $HOME/.cargo/env

Then, verify the Rust version.

:~$ rustc --version

4.- Check the Rust version
4.- Check the Rust version

Create a Hello World file

The best way to prove that Rust is properly installed and configured on your computer is to create and run a Rust file. I’ll do the typical Hello World.

First, create a folder that will serve as Workspace, in it create another folder where the file in question will be.

:~$ mkdir ~/projects
:~$ cd projects
:~$ mkdir example
:~$ cd example

5.- Creating the workspace for Rust
5.- Creating the workspace for Rust

Now, create the file.

:~$ nano helloworld.rs

Then, add the following.

fn main() {
    println!("Hello, thanks for visit Osradar blog.");
}

6.- Create a Hello World file
6.- Create a Hello World file

Save and close the file.

Next, compile the rust file.

:~$ rustc helloworld.rs

After that, a file will be created that is the executable of the code.

Finally, run the file.

:~$ ./helloworld

7.- Compile and run the file
7.- Compile and run the file

And that’s it.

Conclusion

Installing the Rust language in Linux is a fairly simple process. The possibilities offered by this language are many. It is also a great alternative to traditional programming languages.

Please share this article with your friends. So, don’t forget to join our Telegram Channel.

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How to install KVM on Debian 10?

Hello friends, in this post I will show you how to install KVM on Debian 10. KVM stands for...

How to open Windows 10 Mobility Center

Hello! There are many types of users of Windows 10. As it depends on the type of hardware used. That is, the...

Ubuntu 20.04.1 available

Canonical, the company led by Mark Shuttleworth, releases Ubuntu 20.04.1. It has a new image, with updates and security patches for the...

How to install Linux Kernel 5.8 on Ubuntu 20.04?

Upgrading the Linux Kernel can be a beneficial task, but it is always optional. Recently we talked about the Linux Kernel 5.8...

How to activate XPS Viewer in Windows 10

Hey, what's up! When working with Windows 10 we probably use a lot of files. Indeed, these files have many extensions. For...