How To Install popt on CentOS 7

In this tutorial we learn how to install popt on CentOS 7. popt is C library for parsing command line parameters

Introduction

In this tutorial we learn how to install popt on CentOS 7.

What is popt

Popt is a C library for parsing command line parameters. Popt was heavily influenced by the getopt() and getopt_long() functions, but it improves on them by allowing more powerful argument expansion. Popt can parse arbitrary argv[] style arrays and automatically set variables based on command line arguments. Popt allows command line arguments to be aliased via configuration files and includes utility functions for parsing arbitrary strings into argv[] arrays using shell-like rules.

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

Install popt on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

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

sudo yum -y install popt

Install popt on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

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

sudo dnf -y install popt

How To Uninstall popt on CentOS 7

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

sudo dnf remove popt

References

Summary

In this tutorial we learn how to install popt on CentOS 7 using yum and dnf.