Rust-Programming-Language/C2/Installation-of-Rust-on-Linux/English
| Visual Cue | Narration |
| Show Slide:
Title Slide |
Welcome to the Spoken tutorial on Installation of Rust on Linux. |
| Show Slide:
Learning Objectives |
In this tutorial, we will learn how to:
|
| Show Slide:
System Requirements |
To record this tutorial, I am using
|
| Show Slide:
Installation Requirements |
For the installation of Rust
|
| Open the terminal by pressing Ctrl, Alt and T keys simultaneously. | |
| > curl --version
>sudo apt install curl |
First we need to check whether curl is installed in our system
For that, Type curl --version If you see information about curl, it means curl is installed. If you get an error, you have to install curl. Type, sudo apt install curl Enter the password if prompted. |
| Type curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh |
Once curl is installed, type the following command.
You will see a list of options. Press 1 to proceed with default installation. This will install modules and packages like cargo, rustfmt, clippy. These will be useful for development and writing code. |
| Next, we will set up an Integrated Development Environment(IDE). | |
| Open web browser
Type https://code.visualstudio.com</u> |
Open any web browser.
In the address bar type this link. Visual Studio code page opens. Let us download and install Visual Studio Code. |
| Click on the Download button
Click on .deb for Ubuntu. |
Click on the Download button on the top right corner of the window.
You can see options for various operating systems. I will download a .deb file for Ubuntu. |
| Right click on the file select open with software install.
Click on the install button. Type the system password. |
Let us go to the Downloads folder and locate the .deb file.
Right click on the file and select open with software install. Click on the install button. Enter the system password to authenticate. Once the installation is complete, close the window. |
| Go to Show Applications on the bottom left of your screen.
In the search bar, type Visual Studio code. Click on Visual Studio Code to open the window. |
Let us open the Visual Studio code.
Go to Show Applications on the bottom left of your screen. In the search bar, type Visual Studio code. Click on Visual Studio Code to open the window. |
| Locate rust-analyzer and click on Install button. | On the left toolbar, click on Extensions icon
The Extensions panel opens. In the Search bar type, rust-analyzer and Press Enter A list of options will appear. Locate rust-analyzer and click on Install button. Once the installation is complete a blue tick mark appears. Rust analyzer extension is used to autocomplete the code. It makes the code more readable. |
| In the terminal, type
> rustc –version 1.79.0 |
We can verify the installation by running these commands on the terminal.
rustc --version We can see the Rust compiler version that has been installed. |
| >cargo –version | Type,
cargo --version This will show the package manager and build system version. |
| > rustup –version | Type,
rustup --version This shows the rustup toolchain manager version. |
| You have to restart the system after the rust installation is completed. | |
| Open the text editor
fn main() { println!("Hello, World!"); } |
Now, let's write our first Rust program.
Open the text editor. Type the following code.
|
| Highlight according to narration | In this program, we will print “Hello, World!”
Save the file by pressing Ctrl + S. Type the file name as Helloworld.rs and save it on the Desktop. |
| >cd Desktop
> rustc Helloworld.rs > ./Helloworld |
Switch back to the terminal.
Go to the folder where we have saved the rust program. Type cd Desktop Then type, rustc Helloworld.rs This will compile the program. Type ./Helloworld to run the program. We can see the output: Hello, World! |
| This shows we have successfully installed Rust and compiled and executed a program. | |
| Show Slide:
Summary |
This brings us to the end of this tutorial.
Let us summarize. |
| Show Slide: | Thank you for joining. |