I know this is an old post but this information is not readily available.

On a packaged managed system like CentOS, please do not use cpan to install packages. It is not an enterprise solution since most companies will not let you install software from the Internet for production systems and you will just have to figure out some other way to package your software anyway. The correct method is to build your own RPMs with `cpanspec`.

$ wget https://cpan.metacpan.org/authors/id/J/JM/JMCNAMARA/Excel-Write +r-XLSX-1.03.tar.gz $ cpanspec -b Excel-Writer-XLSX-1.03.tar.gz

Unfortunately, for Excel-Writer-XLSX, cpanspec did not pick up the installed man page and script in /usr/bin.

> error: Installed (but unpackaged) file(s) found: > /usr/bin/extract_vba > /usr/share/man/man1/extract_vba.1.gz

So, I had to manually add those paths to the SPEC %files section and try again.

%files %{_mandir}/man1/* %{_bindir}/*

Then rebuild it

$ rpmbuild -ba perl-Excel-Writer-XLSX.spec --define "_sourcedir $PWD"

At this point you now have an RPM that you could put on your yum repository and it will be available for all of your systems.

> Wrote: ~/rpmbuild/SRPMS/perl-Excel-Writer-XLSX-1.03-1.el7.stopllc.sr +c.rpm > Wrote: ~/rpmbuild/RPMS/noarch/perl-Excel-Writer-XLSX-1.03-1.el7.stop +llc.noarch.rpm
Or install it with yum from the command line
sudo yum install ~/rpmbuild/RPMS/noarch/perl-Excel-Writer-XLSX-1.03- +1.el7.stopllc.noarch.rpm #only command that needs root permissions

Bonus points

Sign your rpms

rpm --addsign ~/rpmbuild/RPMS/noarch/perl-Excel-Writer-XLSX-1.03-1.e +l7.stopllc.noarch.rpm

Build your own yumrepo with createrepo. If your path is /var/www/html/yumrepo then your yumrepo will be at http://127.0.0.1/yumrepo/ requires `yum install httpd`

sudo mkdir -p /var/www/html/yumrepo/ #only first time sudo mv ~/rpmbuild/RPMS/noarch/perl-Excel-Writer-XLSX-1.03-1.el7.sto +pllc.noarch.rpm /var/www/html/yumrepo/ sudo createrepo /var/www/html/yumrepo # new or deleting rpm +s sudo createrepo --update /var/www/html/yumrepo # if only adding rpms

Configure your yum repo on the client systems (change 127.0.0.1 to your host name)

/etc/yum.repos.d/my.repo [my-repo] name=My Repo baseurl=http://127.0.0.1/yumrepo/ enabled=1 gpgcheck=0

Clean up your older rpm repo versions with repomanage

repomanage --keep=2 --old /var/www/html/yumrepo | xargs -P4 -I'{}' / +bin/rm '{}` # delete versions older than the last two versions createrepo /var/www/html/yumrepo + # rebuild the yum index

In reply to Re^2: Install perl packages using yum by mrdvt92
in thread Install perl packages using yum by ravi45722

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.