How To Install gengetopt on Rocky Linux 8

In this tutorial we learn how to install gengetopt on Rocky Linux 8. gengetopt is Tool to write command line option parsing code for C programs

Introduction

In this tutorial we learn how to install gengetopt on Rocky Linux 8.

What is gengetopt

Gengetopt is a tool to generate C code to parse the command line arguments argc and argv that are part of every C or C++ program. The generated code uses the C library function getopt_long to perform the actual command line parsing.

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

Install gengetopt on Rocky Linux 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

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

sudo dnf -y install gengetopt

Install gengetopt on Rocky Linux 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

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

sudo yum -y install gengetopt

How To Uninstall gengetopt on Rocky Linux 8

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

sudo dnf remove gengetopt

gengetopt Package Contents on Rocky Linux 8

/usr/bin/gengetopt
/usr/lib/.build-id
/usr/lib/.build-id/65
/usr/lib/.build-id/65/0f6db07a733af6986c317f7ece63b93afd47b4
/usr/share/doc/gengetopt
/usr/share/doc/gengetopt/AUTHORS
/usr/share/doc/gengetopt/ChangeLog
/usr/share/doc/gengetopt/NEWS
/usr/share/doc/gengetopt/README
/usr/share/doc/gengetopt/THANKS
/usr/share/doc/gengetopt/TODO
/usr/share/doc/gengetopt/examples
/usr/share/doc/gengetopt/examples/README.example
/usr/share/doc/gengetopt/examples/main1.cc
/usr/share/doc/gengetopt/examples/main2.c
/usr/share/doc/gengetopt/examples/sample1.ggo
/usr/share/doc/gengetopt/examples/sample2.ggo
/usr/share/doc/gengetopt/gengetopt.html
/usr/share/doc/gengetopt/index.html
/usr/share/gengetopt
/usr/share/gengetopt/getopt.c
/usr/share/gengetopt/getopt1.c
/usr/share/gengetopt/gnugetopt.h
/usr/share/info/gengetopt.info.gz
/usr/share/info/index.info.gz
/usr/share/licenses/gengetopt
/usr/share/licenses/gengetopt/COPYING
/usr/share/licenses/gengetopt/LICENSE
/usr/share/man/man1/gengetopt.1.gz

References

Summary

In this tutorial we learn how to install gengetopt on Rocky Linux 8 using yum and dnf.