How To Install sparse on CentOS 8

sparse is A semantic parser of source files

Introduction

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

What is sparse

Sparse is a semantic parser of source files (although it could be used as a front-end for one) nor is it a preprocessor (although it contains as a part of it a preprocessing phase). It is meant to be a small - and simple - library. Scanty and meager, and partly because of that easy to use. It has one mission in life create a semantic parse tree for some arbitrary user for further analysis. It’s not a tokenizer, nor is it some generic context-free parser. In fact, context (semantics) is what it’s all about - figuring out not just what the grouping of tokens are, but what the types are that the grouping implies. Sparse is primarily used in the development and debugging of the Linux kernel.

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

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

sudo dnf -y install sparse

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

sudo yum -y install sparse

How To Uninstall sparse on CentOS 8

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

sudo dnf remove sparse

sparse Package Contents on CentOS 8

/usr/bin/c2xml
/usr/bin/cgcc
/usr/bin/semind
/usr/bin/sparse
/usr/bin/test-inspect
/usr/lib/.build-id
/usr/lib/.build-id/28
/usr/lib/.build-id/28/38a95a218ce68206ba2c37fb9b3ed1fb31f563
/usr/lib/.build-id/ac
/usr/lib/.build-id/ac/e40e884f14ecb779ba79752ebe1b879920917f
/usr/lib/.build-id/c3
/usr/lib/.build-id/c3/793a50c98541d742a16f846767423e8b548d13
/usr/lib/.build-id/fe
/usr/lib/.build-id/fe/a7b3ebaddf106b194583a1b86dd94ad7e668f9
/usr/share/doc/sparse
/usr/share/doc/sparse/FAQ
/usr/share/doc/sparse/LICENSE
/usr/share/doc/sparse/README
/usr/share/man/man1/cgcc.1.gz
/usr/share/man/man1/semind.1.gz
/usr/share/man/man1/sparse.1.gz

References

Summary

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