How To Install rust on CentOS 8

rust is The Rust Programming Language

Introduction

In this tutorial we learn how to install rust on CentOS 8.

What is rust

Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety. This package includes the Rust compiler and documentation generator.

We can use yum or dnf to install rust on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install rust.

Install rust on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install rust using dnf by running the following command:

sudo dnf -y install rust

Install rust on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install rust using yum by running the following command:

sudo yum -y install rust

How To Uninstall rust on CentOS 8

To uninstall only the rust package we can use the following command:

sudo dnf remove rust

rust Package Contents on CentOS 8

/usr/bin/rustc
/usr/bin/rustdoc
/usr/lib/.build-id
/usr/lib/.build-id/0e
/usr/lib/.build-id/0e/cc5bb732564e1827548d13f87423f90b4970f6
/usr/lib/.build-id/1f
/usr/lib/.build-id/1f/c6bb19f97670d7a68e7996eccee3e2f6cffe9d
/usr/lib/.build-id/42
/usr/lib/.build-id/42/c837d876fc3c623a76f8747727e9e5eea0396c
/usr/lib/.build-id/8b
/usr/lib/.build-id/8b/dbd72c0bfedee711ac3a3ce14ae2042297396d
/usr/lib/.build-id/8f
/usr/lib/.build-id/8f/8f7d3b0276207a0add4a70e184d242f6f48246
/usr/lib/.build-id/b3
/usr/lib/.build-id/b3/bf23143a34ecff6b81e4cf43ed377924295569
/usr/lib/.build-id/cd
/usr/lib/.build-id/cd/f0966aa3ad6bf1ee7c4eb60d3479ab92a43f69
/usr/lib/.build-id/ef
/usr/lib/.build-id/ef/dc071a856925734437a19ad20c89128c184797
/usr/lib/rustlib
/usr/lib/rustlib/x86_64-unknown-linux-gnu
/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib
/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-298e90ecb364dd7e.so
/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libtest-8ff28a13152e87d7.so
/usr/lib64/libchalk_derive-a698b67e479946df.so
/usr/lib64/librustc_driver-18b0e99a6a76e0ca.so
/usr/lib64/librustc_macros-6ac9005bf86fe947.so
/usr/lib64/libstd-298e90ecb364dd7e.so
/usr/lib64/libtest-8ff28a13152e87d7.so
/usr/lib64/libtracing_attributes-dce1fe5d875f59e0.so
/usr/share/doc/rust
/usr/share/doc/rust/README.md
/usr/share/licenses/rust
/usr/share/licenses/rust/COPYRIGHT
/usr/share/licenses/rust/LICENSE-APACHE
/usr/share/licenses/rust/LICENSE-MIT
/usr/share/man/man1/rustc.1.gz
/usr/share/man/man1/rustdoc.1.gz

References

Summary

In this tutorial we learn how to install rust on CentOS 8 using yum and dnf.