How To Install rust-analysis on CentOS 8

rust-analysis is Compiler analysis data for the Rust standard library

Introduction

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

What is rust-analysis

This package contains analysis data files produced with rustc’s -Zsave-analysis feature for the Rust standard library. The RLS (Rust Language Server) uses this data to provide information about the Rust standard library.

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

Install rust-analysis 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-analysis using dnf by running the following command:

sudo dnf -y install rust-analysis

Install rust-analysis 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-analysis using yum by running the following command:

sudo yum -y install rust-analysis

How To Uninstall rust-analysis on CentOS 8

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

sudo dnf remove rust-analysis

rust-analysis Package Contents on CentOS 8

/usr/lib/rustlib/x86_64-unknown-linux-gnu/analysis
/usr/lib/rustlib/x86_64-unknown-linux-gnu/analysis/libaddr2line-ab8dbaac4c0d7732.json
/usr/lib/rustlib/x86_64-unknown-linux-gnu/analysis/libadler-b45fa80c9f820131.json
/usr/lib/rustlib/x86_64-unknown-linux-gnu/analysis/liballoc-dc5b96fd3f726f98.json
/usr/lib/rustlib/x86_64-unknown-linux-gnu/analysis/libcfg_if-e8489c1f15fbb688.json
/usr/lib/rustlib/x86_64-unknown-linux-gnu/analysis/libcompiler_builtins-f3b7d6167c6144e8.json
/usr/lib/rustlib/x86_64-unknown-linux-gnu/analysis/libcore-fa27894a72ccaffb.json
/usr/lib/rustlib/x86_64-unknown-linux-gnu/analysis/libgetopts-a4181e3fc73065f2.json
/usr/lib/rustlib/x86_64-unknown-linux-gnu/analysis/libgimli-0e3889b6eeaee63a.json
/usr/lib/rustlib/x86_64-unknown-linux-gnu/analysis/libhashbrown-2ed3659cb2b192e7.json
/usr/lib/rustlib/x86_64-unknown-linux-gnu/analysis/liblibc-fef34517006e769f.json
/usr/lib/rustlib/x86_64-unknown-linux-gnu/analysis/libminiz_oxide-584fcc78417f28df.json
/usr/lib/rustlib/x86_64-unknown-linux-gnu/analysis/libobject-b2f6e937b6e750dc.json
/usr/lib/rustlib/x86_64-unknown-linux-gnu/analysis/libpanic_abort-7541574a84f193be.json
/usr/lib/rustlib/x86_64-unknown-linux-gnu/analysis/libpanic_unwind-461b3fa1efa6d7f1.json
/usr/lib/rustlib/x86_64-unknown-linux-gnu/analysis/libproc_macro-3793ae7bb43ef97a.json
/usr/lib/rustlib/x86_64-unknown-linux-gnu/analysis/librustc_demangle-9fecffcc835d0557.json
/usr/lib/rustlib/x86_64-unknown-linux-gnu/analysis/librustc_std_workspace_alloc-ea332f4c2861957c.json
/usr/lib/rustlib/x86_64-unknown-linux-gnu/analysis/librustc_std_workspace_core-16106dedcf2b37fb.json
/usr/lib/rustlib/x86_64-unknown-linux-gnu/analysis/librustc_std_workspace_std-15e7227797e02896.json
/usr/lib/rustlib/x86_64-unknown-linux-gnu/analysis/libstd-298e90ecb364dd7e.json
/usr/lib/rustlib/x86_64-unknown-linux-gnu/analysis/libterm-b40271cebce2a007.json
/usr/lib/rustlib/x86_64-unknown-linux-gnu/analysis/libtest-8ff28a13152e87d7.json
/usr/lib/rustlib/x86_64-unknown-linux-gnu/analysis/libunicode_width-6631d5ce135c905e.json
/usr/lib/rustlib/x86_64-unknown-linux-gnu/analysis/libunwind-fe758eab1fa21a1e.json

References

Summary

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