How To Install ctags on CentOS 8

ctags is A C programming language indexing and/or cross-reference tool

Introduction

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

What is ctags

Ctags generates an index (or tag) file of C language objects found in C source and header files. The index makes it easy for text editors or other utilities to locate the indexed items. Ctags can also generate a cross reference file which lists information about the various objects found in a set of C language files in human readable form. Exuberant Ctags improves on ctags because it can find all types of C language tags, including macro definitions, enumerated values (values inside enum{…}), function and method definitions, enum/struct/union tags, external function prototypes, typedef names and variable declarations. Exuberant Ctags is far less likely to be fooled by code containing #if preprocessor conditional constructs than ctags. Exuberant ctags supports output of Emacs style TAGS files and can be used to print out a list of selected objects found in source files. Install ctags if you are going to use your system for C programming.

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

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

sudo dnf -y install ctags

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

sudo yum -y install ctags

How To Uninstall ctags on CentOS 8

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

sudo dnf remove ctags

ctags Package Contents on CentOS 8

/usr/bin/ctags
/usr/lib/.build-id
/usr/lib/.build-id/27
/usr/lib/.build-id/27/2b5b2b80333201a9517e8ac53bd02cac3f7fa9
/usr/share/doc/ctags
/usr/share/doc/ctags/EXTENDING.html
/usr/share/doc/ctags/FAQ
/usr/share/doc/ctags/NEWS
/usr/share/doc/ctags/README
/usr/share/licenses/ctags
/usr/share/licenses/ctags/COPYING
/usr/share/man/man1/ctags.1.gz

References

Summary

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