How To Install gnu-getopt.noarch on Amazon Linux 2

In this tutorial we learn how to install gnu-getopt.noarch in Amazon Linux 2. gnu-getopt.noarch is Java getopt implementation

Introduction

In this tutorial we learn how to install gnu-getopt.noarch on Amazon Linux 2.

What is gnu-getopt.noarch

The GNU Java getopt classes support short and long argument parsing in a manner 100% compatible with the version of GNU getopt in glibc 2.0.6 with a mostly compatible programmer’s interface as well. Note that this is a port, not a new implementation. I am currently unaware of any bugs in this software, but there certainly could be some lying about. I would appreciate bug reports as well as hearing about positive experiences.

We can use yum to install gnu-getopt.noarch on Amazon Linux 2. In this tutorial we discuss both methods but you only need to choose one of method to install gnu-getopt.noarch.

Install gnu-getopt.noarch on Amazon Linux 2 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

After updating yum database, We can install gnu-getopt.noarch using yum by running the following command:

sudo yum -y install gnu-getopt.noarch

How To Uninstall gnu-getopt.noarch on Amazon Linux 2

To uninstall only the gnu-getopt.noarch package we can use the following command:

sudo yum remove gnu-getopt.noarch

gnu-getopt.noarch Package Contents on Amazon Linux 2

/usr/share/doc/gnu-getopt-1.0.14
/usr/share/doc/gnu-getopt-1.0.14/COPYING.LIB
/usr/share/doc/gnu-getopt-1.0.14/README
/usr/share/java/gnu-getopt.jar
/usr/share/java/gnu.getopt.jar
/usr/share/maven-fragments/gnu-getopt
/usr/share/maven-poms/JPP-gnu-getopt.pom

References

Summary

In this tutorial we learn how to install gnu-getopt.noarch on Amazon Linux 2 using yum.