How To Install Rust on Fedora 35

Install Rust on Fedora 35

In this tutorial, we will show you how to install Rust on Fedora 35. For those of you who didn’t know, Rust is an open-source programming language that focuses on speed, memory safety, and parallelism. Developers use Rust to create a wide range of new software applications, such as game engines, operating systems, file systems, and simulation engines for virtual reality. Although it is sponsored by Mozilla and Samsung, it is a community project. Its focus is primarily on large programs that run on the client and server sides.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the Rust Programming Language on a Fedora 35.

Prerequisites

  • A server or desktop running one of the following operating systems: Fedora 35 or Fedora 34.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • A non-root sudo useror access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install Rust Programming Language on Fedora 35

Step 1. Before proceeding, update your Fedora operating system to make sure all existing packages are up to date. Use this command to update the server packages:

sudo dnf upgrade
sudo dnf update
sudo dnf install curl dnf-plugins-core install cmake gcc clang make

Step 2. Installing Rust Programming Language on Fedora 35.

By default, Rust is not available on Fedora 35 base repository. Now we download the latest version script installer from the official page:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

During the execution of the script, we will be asked about the type of installation. In this case, choose option 1.

Install Rust Programming Language on Fedora 35

This way the installation has been completed successfully. You will need to activate the (Rust environment) for your current shell:

source ~/.profile
source ~/.cargo/env

Verify the Rust installation:

rustc -V

Step 3. Create Rust Sample Project.

Let’s test Rust using the “Hello, World!” application. First, create a new directory to house our test with the command:

mkdir ~/rust-projects
cd rust-projects
nano helloworld.rs

And add the following code:

fn main() {
println!("Hello World, this is a test provided by idroot.us");
}

Then, run the following command which will create an executable called helloworld in the current directory:

rustc helloworld.rs

To run the application you created using Rust, run the program with the execute command:

./helloworld

Congratulations! You have successfully installed Rust. Thanks for using this tutorial for installing the Rust Programming Language on your Fedora 35 system. For additional help or useful information, we recommend you check the official Rust website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!