{"id":11706,"date":"2022-01-20T17:11:39","date_gmt":"2022-01-20T22:11:39","guid":{"rendered":"http:\/\/local.brightwhiz\/?p=11706"},"modified":"2022-01-20T17:36:30","modified_gmt":"2022-01-20T22:36:30","slug":"how-to-install-rust-on-ubuntu-20-04-using-apt","status":"publish","type":"post","link":"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/","title":{"rendered":"How to Install Rust on Ubuntu 20.04 Using apt"},"content":{"rendered":"\n
Here is yet another tutorial, this time we will be showing you how to install Rust on Ubuntu 20.04 using the apt package utility. Just one thing. To follow along with this tutorial you will need to be 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 Step 1<\/strong>: Update the package list and upgrade any packages.<\/p>\n\n\n\n Step 2<\/strong>: Next, install Rust.<\/p>\n\n\n\n Once the installation is completed you can verify the version of Rust installed in your Ubuntu<\/a> using the following command.<\/p>\n\n\n\n Create a Rust project with a single file to display text to screen.<\/p>\n\n\n\n Create a new file with the .rs extension.<\/p>\n\n\n\n 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 your Ubuntu-based system using the apt package utility. For those on Debian, we have prepared a guide where you can install Rust on Debian 11 here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":" Here is yet another tutorial, this time we will be showing you how to install Rust on Ubuntu 20.04 using the apt package utility. Just one thing. To follow along…<\/p>\n","protected":false},"author":1,"featured_media":11688,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,23,9,27,16,18],"tags":[111,350,424,433,449,471,472,515,526,544,545,591,598],"yoast_head":"\nNow let’s Install Rust on Ubuntu 20.04<\/h2>\n\n\n\n
$ sudo apt update && sudo apt upgrade<\/code><\/pre>\n\n\n\n
$ sudo apt install rustc<\/code><\/pre>\n\n\n\n
$ rustc --version\n\nOutput\nrustc 1.53.0<\/code><\/pre>\n\n\n\n
$ mkdir ~\/projects\n$ cd ~\/projects\n$ mkdir hello_world\n$ cd hello_world<\/code><\/pre>\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