While installing some application, are you facing the error “Can’t locate Getopt/Long.pm in @INC”.

First let understand, what this error means? If you get a Perl error message like "Can’t locate Getopt/Long.pm in @INC”, this message means that the Perl module you’re trying to include (like the module named Getopt-Long) can’t be found in Perl’s include path, which is represented by the variable named @INC.

Finally, if the Perl module you need isn’t already installed on your system, you’re going to need to install it.

Let check how to resolve this error. You can resolve this by downloading the packages on your server.


So find compatible packages at https://centos.pkgs.org.


Now download the latest package and install. This will resolve your issue.


To fix Can’t locate Getopt/Long.pm in @INC error, Install perl-Getopt-Long rpm package using the following command:

# dnf install perl-Getopt-Long


The issue will be resolved.


I hope this quick tip helped you to fix the “Getopt/Long.pm in @INC ” error on Centos/Ubuntu and other Debian-based Linux distributions.


Hai trovato utile questa risposta? 3 Utenti hanno trovato utile questa risposta (5 Voti)