{"id":11703,"date":"2022-01-20T17:11:18","date_gmt":"2022-01-20T22:11:18","guid":{"rendered":"http:\/\/local.brightwhiz\/?p=11703"},"modified":"2022-01-20T17:11:20","modified_gmt":"2022-01-20T22:11:20","slug":"how-to-install-rust-on-debian-11-using-installer-script","status":"publish","type":"post","link":"http:\/\/local.brightwhiz\/how-to-install-rust-on-debian-11-using-installer-script\/","title":{"rendered":"How to Install Rust on Debian 11 Using Installer Script"},"content":{"rendered":"\n
This is the tutorial where you will learn how to install Rust on Debian 11 Linux system. We will be using the terminal and a non-root user with sudo privileges.<\/p>\n\n\n\n
Rust<\/a> is a multi-paradigm, general-purpose programming language<\/a> designed for performance, efficiency, and safety, especially with regards to concurrency. Like C++ it contains no garbage collector and is also syntactically similar but unlike C++ it is type-safe. See more details here<\/a>.<\/p>\n\n\n\n Install Rust on Debian 11<\/p>\n\n\n\n Step 1<\/strong>: Update the package list and upgrade any packages.<\/p>\n\n\n\n Step 2<\/strong>: Install the compiler and other build tools.<\/p>\n\n\n\n Step 3<\/strong>: Install Rust Programming Language on the Debian<\/a> system from the installation script.<\/p>\n\n\n\n Step 4<\/strong>: Execute the following commands to add the rust environment variables.<\/p>\n\n\n\n Step 5<\/strong>: Configure the current shell by running the following command.<\/p>\n\n\n\n Now let’s confirm the installation by running the following command.<\/p>\n\n\n\n Let’s write a simple rust program to display text to screen.<\/p>\n\n\n\n Create a new file with the Add the following function to the file.<\/p>\n\n\n\n Compile and run the program.<\/p>\n\n\n\n Here’s your output.<\/p>\n\n\n\n That’s how to install Rust on Debian 11 using the install script. We have prepared a guide where you can install Rust on Ubuntu 20.04<\/a> using apt package manager.<\/p>\n","protected":false},"excerpt":{"rendered":" This is the tutorial where you will learn how to install Rust on Debian 11 Linux system. We will be using the terminal and a non-root user with sudo privileges….<\/p>\n","protected":false},"author":1,"featured_media":11711,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,23,9,27,16,18],"tags":[111,183,350,424,433,449,471,515,526,544,545,591],"yoast_head":"\n$ sudo apt update && sudo apt upgrade<\/code><\/pre>\n\n\n\n
$ sudo apt install curl build-essential gcc make<\/code><\/pre>\n\n\n\n
wget -qO - https:\/\/sh.rustup.rs | sudo RUSTUP_HOME=\/opt\/rust CARGO_HOME=\/opt\/rust sh -s -- --no-modify-path -y<\/code><\/pre>\n\n\n\n
echo 'export RUSTUP_HOME=\/opt\/rust' | sudo tee -a \/etc\/profile.d\/rust.sh\necho 'export PATH=$PATH:\/opt\/rust\/bin' | sudo tee -a \/etc\/profile.d\/rust.sh<\/code><\/pre>\n\n\n\n
$ source \/etc\/profile\n$ echo $RUSTUP_HOME\n$ echo $PATH<\/code><\/pre>\n\n\n\n
$ rustc --version\n\nOutput\nrustc 1.53.0<\/code><\/pre>\n\n\n\n
Write Your First Rust Program<\/h2>\n\n\n\n
$ mkdir ~\/projects\n$ cd ~\/projects\n$ mkdir hello_world\n$ cd hello_world<\/code><\/pre>\n\n\n\n
.rs<\/code> extension.<\/p>\n\n\n\n
$ sudo nano hello_world.rs<\/code><\/pre>\n\n\n\n
fn main() {\n println!("Hello, world!");\n}<\/code><\/pre>\n\n\n\n
$ rustc hello_world.rs \n$ .\/hello_world<\/code><\/pre>\n\n\n\n
Hello, world!<\/code><\/pre>\n\n\n\n