Hello, friends. Installing Rust on Debian 11 is an important issue for everyone who wants to learn how to program in this programming language. That’s why today in this post, you will learn how to install it quickly and easily.
Rust is a programming language that was born to allow you to write code as fast as C or C++, eliminating the drawbacks with the garbage collector to avoid the problems arising from memory management. This was all thanks to Mozilla, but it has worked so well that many people are using it for many programs.
Currently, Rust is funded by large entities such as Amazon AWS, Microsoft Azure, Google Cloud, Facebook, and, since its inception, Mozilla Firefox. But it is also supported by a large community of users who share their experiences and help those new to the language.
As we know, Rust is quite fast, supports object-oriented programming, and is multi-purpose. So all in all it is an important programming language in our time.
So, let’s go for it.
From the Rust website, we are informed of a very simple installation procedure. This is due to the presence of an installation script that makes everything very easy.
So to start the process, you have to upgrade the operating system completely.
sudo apt update sudo apt upgrade
The download of this script will be done using
curl so it has to be installed on the system.
sudo apt install curl
If you do not have the
build-essential package installed, you need to do so.
sudo apt install build-essential
Now all you have to do is run the following command:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
During the installation process, you will be asked how the installation will be performed. In this case, it is wise to choose option 1 which will install Rust with the default configuration.
When the process finishes, you will be prompted to run a command to update the system environment variables. This will allow us to use Rust commands from any location in the terminal.
And you can also check the compiler version.
rustc --version rustc 1.54.0 (a178d0322 2021-07-26)
When we install Rust, we also install
cargo which is the Rust package manager and provides us with the command line tools to create our project without any problems.
So, we create our project by executing the following command
cargo new [project-name]
cargo new osradar Created binary (application) `osradar` package
This will create a new folder called
osradar which will have a file called
Cargo.toml where you can specify your project dependencies and manifest. Also, there will be a folder called
src where the source code for the application will be. This folder comes with a file called
main.rs which is the main file where we will start our coding.
Now access the folder and run the
Hello World that comes with the
cargo new command.
cd osradar cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.00s Running `target/debug/osradar` Hello, world!
So, Rust is installed correctly.
Rust is a modern programming language that presents an alternative to C++ and can be used in many places and for many things. Installing it on Debian 11 is something we can do without much difficulty as we have explained.