How To Install gengetopt on Fedora 34

gengetopt is Tool to write command line option parsing code for C programs

Introduction

In this tutorial we learn how to install gengetopt on Fedora 34.

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 Fedora 34. In this tutorial we discuss both methods but you only need to choose one of method to install gengetopt.

Install gengetopt on Fedora 34 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

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

sudo dnf -y install gengetopt

Install gengetopt on Fedora 34 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

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 Fedora 34

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

sudo dnf remove gengetopt

gengetopt Package Contents on Fedora 34

/usr/bin/gengetopt
/usr/lib/.build-id
/usr/lib/.build-id/95
/usr/lib/.build-id/95/2c8dd46fe9c39f0e69ab121c806ceae3f9c209
/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 Fedora 34 using yum and dnf.