How To Install indent on CentOS 8

indent is A GNU program for formatting C code

Introduction

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

What is indent

Indent is a GNU program for beautifying C code, so that it is easier to read. Indent can also convert from one C writing style to a different one. Indent understands correct C syntax and tries to handle incorrect C syntax. Install the indent package if you are developing applications in C and you want a program to format your code.

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

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

sudo dnf -y install indent

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

sudo yum -y install indent

How To Uninstall indent on CentOS 8

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

sudo dnf remove indent

indent Package Contents on CentOS 8

/usr/bin/indent
/usr/lib/.build-id
/usr/lib/.build-id/40
/usr/lib/.build-id/40/0775872bb862c3f3b6a2a4ba316ae35923a41e
/usr/share/doc/indent
/usr/share/doc/indent/AUTHORS
/usr/share/doc/indent/ChangeLog
/usr/share/doc/indent/ChangeLog-1990
/usr/share/doc/indent/ChangeLog-1998
/usr/share/doc/indent/ChangeLog-2001
/usr/share/doc/indent/NEWS
/usr/share/doc/indent/README.md
/usr/share/info/indent.info.gz
/usr/share/licenses/indent
/usr/share/licenses/indent/COPYING
/usr/share/locale/bg/LC_MESSAGES/indent.mo
/usr/share/locale/ca/LC_MESSAGES/indent.mo
/usr/share/locale/cs/LC_MESSAGES/indent.mo
/usr/share/locale/da/LC_MESSAGES/indent.mo
/usr/share/locale/de/LC_MESSAGES/indent.mo
/usr/share/locale/el/LC_MESSAGES/indent.mo
/usr/share/locale/eo/LC_MESSAGES/indent.mo
/usr/share/locale/es/LC_MESSAGES/indent.mo
/usr/share/locale/et/LC_MESSAGES/indent.mo
/usr/share/locale/eu/LC_MESSAGES/indent.mo
/usr/share/locale/fi/LC_MESSAGES/indent.mo
/usr/share/locale/fr/LC_MESSAGES/indent.mo
/usr/share/locale/ga/LC_MESSAGES/indent.mo
/usr/share/locale/gl/LC_MESSAGES/indent.mo
/usr/share/locale/hr/LC_MESSAGES/indent.mo
/usr/share/locale/hu/LC_MESSAGES/indent.mo
/usr/share/locale/id/LC_MESSAGES/indent.mo
/usr/share/locale/it/LC_MESSAGES/indent.mo
/usr/share/locale/ja/LC_MESSAGES/indent.mo
/usr/share/locale/ko/LC_MESSAGES/indent.mo
/usr/share/locale/nl/LC_MESSAGES/indent.mo
/usr/share/locale/pl/LC_MESSAGES/indent.mo
/usr/share/locale/pt_BR/LC_MESSAGES/indent.mo
/usr/share/locale/ro/LC_MESSAGES/indent.mo
/usr/share/locale/ru/LC_MESSAGES/indent.mo
/usr/share/locale/sk/LC_MESSAGES/indent.mo
/usr/share/locale/sr/LC_MESSAGES/indent.mo
/usr/share/locale/sv/LC_MESSAGES/indent.mo
/usr/share/locale/tr/LC_MESSAGES/indent.mo
/usr/share/locale/uk/LC_MESSAGES/indent.mo
/usr/share/locale/vi/LC_MESSAGES/indent.mo
/usr/share/locale/zh_CN/LC_MESSAGES/indent.mo
/usr/share/locale/zh_TW.Big5/LC_MESSAGES/indent.mo
/usr/share/locale/zh_TW/LC_MESSAGES/indent.mo
/usr/share/man/man1/indent.1.gz

References

Summary

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