What is a proper way to install Perl modules on CentOS 7?

Issues related to applications and software problems
Post Reply
compass
Posts: 49
Joined: 2011/02/25 17:44:25

What is a proper way to install Perl modules on CentOS 7?

Post by compass » 2016/03/04 10:07:53

Hi there,

I have some Perl modules installed on CentOS 6 and now I'm migrating to CentOS 7. "yum search MODULNAME" return "No matches found". Im not sure which repo should I search. I also don't want any conflicts between repos in the future. There are many ways to install Perl moduls, but what is the proper way? I have nothing super special, all of modules I require are quite old and common.

Please, advice. Althougth I use CentOS for the long time I'm setting it very rare, mostly when moving to the new hardware. Thank you in advance!

pjwelsh
Posts: 2632
Joined: 2007/01/07 02:18:02
Location: Central IL USA

Re: What is a proper way to install Perl modules on CentOS 7

Post by pjwelsh » 2016/03/04 12:48:34

Whatever you do, do NOT install via CPAN directly!

"cpanspec" is currently the best of the options IMHO. I have used it exclusively with the Centos7 perl modules I've needed to build. Just "yum install cpanspec" to get the utility and deps. Make sure to setup your .rpmmacros appropriately. There are lots of howto's on setting things up to run cpanspec. It can still be frustrating to need to go through dependency hell sometimes to get perl-wizbang9 installed, however.

Edit: "old and common" should generally mean available from epel, elrepo or similar useful repositories. See https://wiki.centos.org/AdditionalResou ... positories for some clues.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: What is a proper way to install Perl modules on CentOS 7

Post by TrevorH » 2016/03/04 13:11:54

Also, yum search is not a reliable way to find the packages. Use yum provides instead and use a filename that you know should be in the package that you want to find - e.g yum provides '*/File/Glob.pm'
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

compass
Posts: 49
Joined: 2011/02/25 17:44:25

Re: What is a proper way to install Perl modules on CentOS 7

Post by compass » 2016/03/04 13:44:29

Maybe I'm doing something wrong...

Code: Select all

# yum install cpanspec
Loaded plugins: fastestmirror, langpacks
base                                                                                                                                                                          | 3.6 kB  00:00:00
extras                                                                                                                                                                        | 3.4 kB  00:00:00
mysql-connectors-community                                                                                                                                                    | 2.5 kB  00:00:00
mysql-tools-community                                                                                                                                                         | 2.5 kB  00:00:00
mysql56-community                                                                                                                                                             | 2.5 kB  00:00:00
updates                                                                                                                                                                       | 3.4 kB  00:00:00
(1/3): extras/7/x86_64/primary_db                                                                                                                                             | 101 kB  00:00:00
(2/3): mysql-tools-community/x86_64/primary_db                                                                                                                                |  25 kB  00:00:00
(3/3): updates/7/x86_64/primary_db                                                                                                                                            | 3.1 MB  00:00:00
Loading mirror speeds from cached hostfile
 * base: mirror.logol.ru
 * extras: mirror.logol.ru
 * updates: mirror.logol.ru
No package cpanspec available.
Error: Nothing to do


User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: What is a proper way to install Perl modules on CentOS 7

Post by TrevorH » 2016/03/04 14:13:41

You don't have EPEL installed or enabled. Fedora EPEL is "Extra Packages for Enterprise Linux". You can install it using yum --enablerepo=extras install epel-release

You may also find that useful as EPEL has roughly 800 perl* packages available, already built and ready to go
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

compass
Posts: 49
Joined: 2011/02/25 17:44:25

Re: What is a proper way to install Perl modules on CentOS 7

Post by compass » 2016/03/06 11:45:00

Thanks for your help, people. I've installed EPEL and cpanspec. Some modules were found and installed, but some still missed. Fore example I need Net::Twitter but here only perl-Net-Twitter-Lite.noarch, which doesn't work for me. Now I'm confused, what to do next?

There are https://wiki.centos.org/AdditionalResou ... positories and https://wiki.centos.org/HowTos/SetupRpmBuildEnvironment - which way should I go?

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: What is a proper way to install Perl modules on CentOS 7

Post by TrevorH » 2016/03/06 17:38:02

If no reputable yum repository has the perl packages that you are wanting then you will need to provide them yourself and the best way to do this is by using cpanspec and a program called mock which is in EPEL. Mock will build things in a clean environment so that you do not need to have things like development tools installed by default - mock creates a chroot, installs everything required for the package, builds it and saves it and then you can clean up mock's chroot if disk space is at a premium. Sometimes the spec files emitted by cpanspec need to be edited to add lines like "BuildRequires: perl-some-pther-package" so that mock knows it's required for the build.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

dunwell
Posts: 116
Joined: 2010/12/20 18:49:52
Location: Colorado
Contact:

Re: What is a proper way to install Perl modules on CentOS 7

Post by dunwell » 2016/03/07 03:11:14

Sometimes yum will not find what you want unless it is specified exactly, as with the version #, etc

I often also use

Code: Select all

yum list all |grep ThingIWantHere
That allows you to just put in text that is probably part of the name and let it locate the multitude of things that have the string in the name. Then you can yum install the specific one you want. Use some common sense or you can get a rather large list. Just

Code: Select all

yum list all | grep perl
might take days to go through. :P

Also note that doesn't give you a list of what might be local but instead it list all from various repositories it knows

Alan D.

Post Reply