{"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

Now let’s Install Rust on Ubuntu 20.04<\/h2>\n\n\n\n

Step 1<\/strong>: Update the package list and upgrade any packages.<\/p>\n\n\n\n

$ sudo apt update && sudo apt upgrade<\/code><\/pre>\n\n\n\n

Step 2<\/strong>: Next, install Rust.<\/p>\n\n\n\n

$ sudo apt install rustc<\/code><\/pre>\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

$ rustc --version\n\nOutput\nrustc 1.53.0<\/code><\/pre>\n\n\n\n

Create a Rust project with a single file to display text to screen.<\/p>\n\n\n\n

$ mkdir ~\/projects\n$ cd ~\/projects\n$ mkdir hello_world\n$ cd hello_world<\/code><\/pre>\n\n\n\n

Create a new file with the .rs extension.<\/p>\n\n\n\n

$ sudo nano hello_world.rs<\/code><\/pre>\n\n\n\n

Add the following function to the file.<\/p>\n\n\n\n

fn main() {\n    println!("Hello, world!");\n}<\/code><\/pre>\n\n\n\n

Compile and run the program.<\/p>\n\n\n\n

$ rustc hello_world.rs \n$ .\/hello_world<\/code><\/pre>\n\n\n\n

Here’s your output.<\/p>\n\n\n\n

Hello, world!<\/code><\/pre>\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":"\nDo This to Install Rust on Ubuntu 20.04 Using apt<\/title>\n<meta name=\"description\" content=\"In this tutorial, we show how to install Rust on Ubuntu 20.04 Linux systems from the programming languages repositories using the apt utility\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Do This to Install Rust on Ubuntu 20.04 Using apt\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, we show how to install Rust on Ubuntu 20.04 Linux systems from the programming languages repositories using the apt utility\" \/>\n<meta property=\"og:url\" content=\"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/\" \/>\n<meta property=\"og:site_name\" content=\"Brightwhiz.com\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/brightwhiz\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-01-20T22:11:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-01-20T22:36:30+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/Install-Rust-on-Ubuntu.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"680\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Michael Bright\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:site\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Michael Bright\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/\"},\"author\":{\"name\":\"Michael Bright\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\"},\"headline\":\"How to Install Rust on Ubuntu 20.04 Using apt\",\"datePublished\":\"2022-01-20T22:11:39+00:00\",\"dateModified\":\"2022-01-20T22:36:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/\"},\"wordCount\":200,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/Install-Rust-on-Ubuntu.jpg\",\"keywords\":[\"C++\",\"Libraries\",\"Open Source\",\"Optimization\",\"Performance\",\"Programming\",\"Programming Languages\",\"Rust\",\"Security\",\"Software development\",\"Software Engineering\",\"Tools\",\"Ubuntu\"],\"articleSection\":[\"Articles\",\"Guides\",\"How To\",\"Programming\",\"Technology\",\"Tools\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/\",\"url\":\"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/\",\"name\":\"Do This to Install Rust on Ubuntu 20.04 Using apt\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/Install-Rust-on-Ubuntu.jpg\",\"datePublished\":\"2022-01-20T22:11:39+00:00\",\"dateModified\":\"2022-01-20T22:36:30+00:00\",\"description\":\"In this tutorial, we show how to install Rust on Ubuntu 20.04 Linux systems from the programming languages repositories using the apt utility\",\"breadcrumb\":{\"@id\":\"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/#primaryimage\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/Install-Rust-on-Ubuntu.jpg\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/Install-Rust-on-Ubuntu.jpg\",\"width\":1280,\"height\":680,\"caption\":\"How to Install Rust on Ubuntu 20.04\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/local.brightwhiz\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install Rust on Ubuntu 20.04 Using apt\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/local.brightwhiz\/#website\",\"url\":\"http:\/\/local.brightwhiz\/\",\"name\":\"Brightwhiz.com\",\"description\":\"Best Tech guides, Tutorials, and News\",\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/local.brightwhiz\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/local.brightwhiz\/#organization\",\"name\":\"Brightwhiz\",\"url\":\"http:\/\/local.brightwhiz\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"width\":706,\"height\":135,\"caption\":\"Brightwhiz\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/brightwhiz\/\",\"https:\/\/x.com\/brightwhizmag\",\"https:\/\/instagram.com\/bright_whiz\/\",\"https:\/\/www.pinterest.com\/sobbayi\/\",\"https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\",\"name\":\"Michael Bright\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"caption\":\"Michael Bright\"},\"sameAs\":[\"https:\/\/sobbayi.com\"],\"url\":\"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Do This to Install Rust on Ubuntu 20.04 Using apt","description":"In this tutorial, we show how to install Rust on Ubuntu 20.04 Linux systems from the programming languages repositories using the apt utility","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/","og_locale":"en_US","og_type":"article","og_title":"Do This to Install Rust on Ubuntu 20.04 Using apt","og_description":"In this tutorial, we show how to install Rust on Ubuntu 20.04 Linux systems from the programming languages repositories using the apt utility","og_url":"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/","og_site_name":"Brightwhiz.com","article_publisher":"https:\/\/www.facebook.com\/brightwhiz\/","article_published_time":"2022-01-20T22:11:39+00:00","article_modified_time":"2022-01-20T22:36:30+00:00","og_image":[{"width":1280,"height":680,"url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/Install-Rust-on-Ubuntu.jpg","type":"image\/jpeg"}],"author":"Michael Bright","twitter_card":"summary_large_image","twitter_creator":"@brightwhizmag","twitter_site":"@brightwhizmag","twitter_misc":{"Written by":"Michael Bright","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/#article","isPartOf":{"@id":"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/"},"author":{"name":"Michael Bright","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32"},"headline":"How to Install Rust on Ubuntu 20.04 Using apt","datePublished":"2022-01-20T22:11:39+00:00","dateModified":"2022-01-20T22:36:30+00:00","mainEntityOfPage":{"@id":"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/"},"wordCount":200,"commentCount":0,"publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"image":{"@id":"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/Install-Rust-on-Ubuntu.jpg","keywords":["C++","Libraries","Open Source","Optimization","Performance","Programming","Programming Languages","Rust","Security","Software development","Software Engineering","Tools","Ubuntu"],"articleSection":["Articles","Guides","How To","Programming","Technology","Tools"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/","url":"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/","name":"Do This to Install Rust on Ubuntu 20.04 Using apt","isPartOf":{"@id":"http:\/\/local.brightwhiz\/#website"},"primaryImageOfPage":{"@id":"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/#primaryimage"},"image":{"@id":"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/Install-Rust-on-Ubuntu.jpg","datePublished":"2022-01-20T22:11:39+00:00","dateModified":"2022-01-20T22:36:30+00:00","description":"In this tutorial, we show how to install Rust on Ubuntu 20.04 Linux systems from the programming languages repositories using the apt utility","breadcrumb":{"@id":"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/#primaryimage","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/Install-Rust-on-Ubuntu.jpg","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/Install-Rust-on-Ubuntu.jpg","width":1280,"height":680,"caption":"How to Install Rust on Ubuntu 20.04"},{"@type":"BreadcrumbList","@id":"http:\/\/local.brightwhiz\/how-to-install-rust-on-ubuntu-20-04-using-apt\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/local.brightwhiz\/"},{"@type":"ListItem","position":2,"name":"How to Install Rust on Ubuntu 20.04 Using apt"}]},{"@type":"WebSite","@id":"http:\/\/local.brightwhiz\/#website","url":"http:\/\/local.brightwhiz\/","name":"Brightwhiz.com","description":"Best Tech guides, Tutorials, and News","publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/local.brightwhiz\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/local.brightwhiz\/#organization","name":"Brightwhiz","url":"http:\/\/local.brightwhiz\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","width":706,"height":135,"caption":"Brightwhiz"},"image":{"@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/brightwhiz\/","https:\/\/x.com\/brightwhizmag","https:\/\/instagram.com\/bright_whiz\/","https:\/\/www.pinterest.com\/sobbayi\/","https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ"]},{"@type":"Person","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32","name":"Michael Bright","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/","url":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","contentUrl":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","caption":"Michael Bright"},"sameAs":["https:\/\/sobbayi.com"],"url":"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/"}]}},"_links":{"self":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/11706"}],"collection":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/comments?post=11706"}],"version-history":[{"count":0,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/11706\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media\/11688"}],"wp:attachment":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media?parent=11706"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/categories?post=11706"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/tags?post=11706"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}