<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ServerAdmins.NET &#187; installation</title>
	<atom:link href="http://serveradmins.net/tag/installation/feed/" rel="self" type="application/rss+xml" />
	<link>http://serveradmins.net</link>
	<description>Stuff for Server Admins...</description>
	<lastBuildDate>Wed, 22 Feb 2012 02:04:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Perl module installation made easy. :)</title>
		<link>http://serveradmins.net/perl-module-installation-made-easy/</link>
		<comments>http://serveradmins.net/perl-module-installation-made-easy/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 00:43:03 +0000</pubDate>
		<dc:creator>chrism</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Utility]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[cpan]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[redhat]]></category>

		<guid isPermaLink="false">http://serveradmins.net/?p=46</guid>
		<description><![CDATA[A basic primer on installing perl modules.]]></description>
			<content:encoded><![CDATA[<p>Hey there!</p>
<p>I&#8217;m going to show you a few different ways to install Perl modules in a quick and easy way.  </p>
<p>First up, the one liner. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><code>perl -MCPAN -e 'install HTML::Template'<br />
CPAN: CPAN::SQLite loaded ok (v0.199)<br />
CPAN: LWP::UserAgent loaded ok (v5.834)<br />
CPAN: Time::HiRes loaded ok (v1.9719)<br />
Fetching with LWP:</p>
<p>http://www.stathy.com/CPAN/authors/01mailrc.txt.gz</p>
<p>CPAN: YAML loaded ok (v0.71)<br />
Fetching with LWP:</p>
<p>http://www.stathy.com/CPAN/modules/02packages.details.txt.gz</p>
<p>Fetching with LWP:</p>
<p>http://www.stathy.com/CPAN/modules/03modlist.data.gz</p>
<p>Database was generated on Thu, 21 Jan 2010 20:40:30 GMT<br />
Updating database file ...</p>
<p>Gathering information from index files ...<br />
Obtaining current state of database ...<br />
Populating database tables ...<br />
....  snipped for brevity....<br />
Running make install<br />
Prepending /home/.cpan/build/HTML-Template-2.9-bALXdn/blib/arch /home/.cpan/build/HTML-Template-2.9-bALXdn/blib/lib to PERL5LIB for 'install'<br />
Installing /usr/local/lib/perl5/site_perl/5.8.8/HTML/Template.pm<br />
Appending installation info to /usr/local/lib/perl5/5.8.8/x86_64-linux/perllocal.pod<br />
  SAMTREGAR/HTML-Template-2.9.tar.gz<br />
  /usr/bin/make install UNINST=1 OTHERLDFLAGS=-L/usr/lib64 LDFLAGS=-L/usr/lib64 EXTRALIBDIR=/usr/lib64 -- OK<br />
[root@vps ~]#<br />
</code></p>
<p>And there you go, quick and easy.   </p>
<p>Now a lot of Perl modules are going to require other modules to be built, in which case, you&#8217;ll see something like this&#8230;<br />
<code><br />
Writing Makefile for Net::SSH::Perl<br />
---- Unsatisfied dependencies detected during ----<br />
----     TURNSTEP/Net-SSH-Perl-1.34.tar.gz    ----<br />
    Crypt::DSA [requires]<br />
    Convert::PEM [requires]<br />
    Crypt::RSA [requires]<br />
    Math::Pari [requires]<br />
    Crypt::IDEA [requires]<br />
    Digest::BubbleBabble [requires]<br />
    Crypt::DH [requires]<br />
    Math::GMP [requires]<br />
Shall I follow them and prepend them to the queue<br />
of modules we are processing right now? [yes]<br />
</code></p>
<p>Just go ahead and answer &#8220;yes&#8221; here, and let it continue&#8230;  cpan *should* be smart enough to grab all of the required sources and build what you need, but sometimes, not so much. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />    Perl modules are basically subroutines packaged into nice containers, ready to use.  Now some of these require specific programs, libraries or even other perl modules to do what they do best.  When a module has a large chain of dependencies and one of those fails, it can bring the whole show to a screeching halt.  </p>
<p>For an example here, I&#8217;ll use Net::SSH::Perl, which happens to be what I use for a host of different things.</p>
<p>If you use the above listed one-liner to install it, i.e., </p>
<p><code>perl -MCPAN -e 'install HTML::Template'</code></p>
<p>You&#8217;re going to end up seeing this&#8230;</p>
<p><code><br />
Files=12, Tests=106,  1 wallclock secs ( 0.07 usr  0.04 sys +  0.40 cusr  0.14 csys =  0.65 CPU)<br />
Result: PASS<br />
  TURNSTEP/Net-SSH-Perl-1.34.tar.gz<br />
Tests succeeded but 2 dependencies missing (Crypt::DH,Math::GMP)<br />
  TURNSTEP/Net-SSH-Perl-1.34.tar.gz<br />
  [dependencies] -- NA<br />
Running make install<br />
  make test had returned bad status, won't install without force<br />
</code></p>
<p>So, we have a dependency of Net::SSH::Perl that simply isn&#8217;t present.  So let&#8217;s go ahead and get it installed&#8230;</p>
<p>On a RH Based system (CentOS/Trustix/RedHat Enterprise Linux), you can do the following&#8230;</p>
<p><code><br />
yum install gmp-devel<br />
</code></p>
<p>On a Debian based distribution (Debian/Ubuntu, etc)<br />
<code><br />
apt-get install libgmp-ocaml<br />
</code></p>
<p>On FreeBSD, I prefer prots builds personally, so let&#8217;s do the following&#8230;<br />
<code><br />
cd /usr/ports/math/libgmp4<br />
make &#038;&#038; make install<br />
</code></p>
<p>So, now that you&#8217;ve got that taken care of, let&#8217;s proceed. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><code><br />
 perl -MCPAN -e 'install Net::SSH::Perl'<br />
...<br />
...<br />
Tests succeeded but one dependency not OK (Crypt::DH)<br />
  TURNSTEP/Net-SSH-Perl-1.34.tar.gz<br />
  [dependencies] -- NA<br />
Running make install<br />
  make test had returned bad status, won't install without force<br />
</code></p>
<p>So, we need to build Crypt::DH&#8230; Apparently dependency handling isn&#8217;t too bright in this case. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />    I&#8217;ll save you the trouble of the blow-by-blow here.  We need to install Crypt::DH which depends on Math::BigInt::GMP.   So, use your handy oneline skills, and get Math::BigInt::GMP installed, then do the same for Crypt::DH.   You should now have a working Net::SSH::Perl installation. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>You can specify multiple packages in the following way&#8230;</p>
<p><code><br />
perl -MCPAN -e 'install Net::SSH, Term::ReadLine'<br />
</code></p>
<p>The other option, should cpan fail, is to just grab the module package yourself, which is typically a .tar.gz file, and perform the following.</p>
<p><code><br />
wget http://search.cpan.org/CPAN/authors/id/T/TU/TURNSTEP/Net-SSH-Perl-1.34.tar.gz<br />
tar -xzvf Net-SSH-Perl-1.34.tar.gz<br />
cd ./Net-SSH-Perl-1.34<br />
perl Makefile.PL<br />
make &#038;&#038; make install<br />
</code></p>
<p>That&#8217;s more or less what cpan is doing, except it will try to sort out requirements and dependencies for you (when it can).</p>
<p>So I hope you&#8217;ve learned a bit of something about getting Perl modules installed and running. If you have any questions, feel free to leave a comment. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://serveradmins.net/perl-module-installation-made-easy/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
