Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Linux » How to install Rust in a Linux System
  • Screenshot 2021 01 22 at 23.27.30
    How does Bitlocker Network Unlock work? Windows Server
  • microsoft logo rgb wht
    All about Group Policies: Group Policy GPUpdate Commands Windows Server
  • windows 10 creators update wallpaper 1
    How to locate and edit the host file on Windows Windows Server
  • Create an S3 Bucket
    Backup Repository: How to Create Amazon S3 buckets AWS/Azure/OpenShift
  • Screenshot 2021 09 02 at 20.08.14
    Service Principal Name: How to add or reset and delete SPNs Windows
  • Protecting DS923 NAS
    DSM Security: How to Protect Synology DS923+ NAS Reviews
  • certificate import and export on windows
    Export and Convert Private Keys to .PEM Format in Windows Windows
  • 0227 15
    How to set Execution Policy via Windows PowerShell Windows Server

How to install Rust in a Linux System

Posted on 30/07/202228/06/2023 Raphael Gab-Momoh By Raphael Gab-Momoh No Comments on How to install Rust in a Linux System
RUST-FEATURE

Rust is a multi-paradigm, general-purpose which is a very fast, and memory-efficient programming language with no runtime or garbage collector that integrates seamlessly with other languages. This article will show you How to install Rust in a Linux System. More specifically, running Rust programming language on Ubuntu 20.04 LTS and starting a Rust project. Other similar guides are here: How to install Zabbix Monitoring Tool on a Linux System and How to Install MongoDB on a Linux System and How to Set Up Flutter with Android Studio on Linux and How to restore quarantined files in Microsoft Defender Antivirus and How to restore quarantined files in Microsoft Defender

You may also be interested in these: How to Delete Diagnostic Data in Windows 10 and Windows 11 and How to Create Symbolic Links in Linux and How to create Windows 11 Bootable USB drive with the Media Creation Tool and Create Disk Cleanup Shortcut: How to Perform Disk Clean-up in Windows and Quit the Editor: How to exit the Linux Vim or Vi editor

Prerequisites for running Rust on Linux

  • A Linux Machine (Ubuntu 20.04)
  • Access to Terminal
  • A user account with Sudo privileges

Update the System Repositories

Before we begin installing Rust on Ubuntu, we need to ensure that all our system repositories are up to date. To do this, we must use the apt package management tool to change our default repositories.

To do so, launch the terminal on your Ubuntu machine and enter the following command.

apt update

Next, we will use the upgrade command in our terminal

sudo apt upgrade

Install Rust on Linux

Despite the many ways to install Rust on Linux, the rustup shell script is the most recommended.

On the official Rust website, this is the recommended way to install Rust on Ubuntu. This is the strategy we shall employ in this lesson. To utilize the rustup installer, type the following command:

curl https://sh.rustup.rs -sSf | sh
welcome-
welcome

Next, you need to select option 1 and the result will be as shown below:

next
option 1 selected

You can also install rust with the official package manager for Ubuntu

sudo apt install rustc
method2
apt install

Apt method took longer so, for the purpose of this tutorial, method 1 is the preferred method of installing Rustc. We can also use the command below:

snap install rustup

Whichever method you decide to go with, Rust and its dependencies will be installed. After the installation is complete, use the following command as shown below to check the version of Rust that is installed in your Ubuntu.

rustc --version
rush-version
rust –version

Create a Rust Project

You may start working on your first project after installing Rust. You can choose to call your directory anything you want, in our own case we decided to use techdirectarchive and hello_world

mkdir ~/techdirectarchive
cd ~/techdirectarchive
mkdir hello_world
cd hello_world
directories
directories

Make a new file with the extension.rs If your file name contains more than one word, use the underscore hello world.rs instead of helloworld.rs.

sudo vim hello_world.rs

Paste the following code inside the new file.

fn main() {
println!("Hello, world!");
}

Hit escape   on your keyboard followed by : and wq to save the file.

Now compile and run the program.

rustc hello_world.rs 
./hello_world
hello-world
Hello world output
Congratulations. Have fun with your Rust installation.

In this article, we learnt how to install Rust in a Linux System by following the steps above and we also got to also see other available options for installation. Finally, we created a mini project to see rust in action.

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to share on Threads (Opens in new window) Threads
  • Click to share on Nextdoor (Opens in new window) Nextdoor
Linux Tags:Linux distro

Post navigation

Previous Post: How to Install Zabbix Monitoring Tool on a Linux System
Next Post: How to use the voice input instead of typing on Windows

Related Posts

  • zabbix
    Monitoring services using Zabbix Linux
  • portainer feature
    How to Install Docker Portainer on Linux Containers
  • download
    Remove Packages from a Linux: Quick Guide Linux
  • 1 pUEZd8z  1p 7ICIO1NZFA
    The package python-virtualenv has no installation candidate error Linux
  • SU
    How to switch users in Linux Linux
  • Slide2 3
    Sudo Error on Ubuntu: Fixing ‘unknown uid 1000: Who are you?’ Linux

More Related Articles

zabbix Monitoring services using Zabbix Linux
portainer feature How to Install Docker Portainer on Linux Containers
download Remove Packages from a Linux: Quick Guide Linux
1 pUEZd8z  1p 7ICIO1NZFA The package python-virtualenv has no installation candidate error Linux
SU How to switch users in Linux Linux
Slide2 3 Sudo Error on Ubuntu: Fixing ‘unknown uid 1000: Who are you?’ Linux

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • Screenshot 2021 01 22 at 23.27.30
    How does Bitlocker Network Unlock work? Windows Server
  • microsoft logo rgb wht
    All about Group Policies: Group Policy GPUpdate Commands Windows Server
  • windows 10 creators update wallpaper 1
    How to locate and edit the host file on Windows Windows Server
  • Create an S3 Bucket
    Backup Repository: How to Create Amazon S3 buckets AWS/Azure/OpenShift
  • Screenshot 2021 09 02 at 20.08.14
    Service Principal Name: How to add or reset and delete SPNs Windows
  • Protecting DS923 NAS
    DSM Security: How to Protect Synology DS923+ NAS Reviews
  • certificate import and export on windows
    Export and Convert Private Keys to .PEM Format in Windows Windows
  • 0227 15
    How to set Execution Policy via Windows PowerShell Windows Server

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,839 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.