[Melbourne-pm] CPAN Vs Package managers

Paul Fenwick pjf at perltraining.com.au
Wed May 9 19:36:23 PDT 2007

G'day Leigh/ MPM,

Leigh Sharpe wrote:

> Just wanted some people's thoughts on what the 'best' way to install
> perl modules on linux is: CPAN or your distro's package manager.

I have a Debian background, so your mileage may vary for other systems.
However under Debian I've always found that using the distro's package
manager has *always* been the correct solution.

Installing a Debian package means that anything that lists that package as a
dependency is happy.  It means that if the Debian security team finds a
nasty flaw, it will get updated in a timely fashion.  It means that other
any other Debian package I install should work nicely with the installed
modules, rather than me having to worry about versions and compatibility.

Furthermore, if you're working with other sysadmins, they can find a list of
installed software and modules quickly and easily.  They don't need to
understand Perl or CPAN to get things installed or changed; they only need
to understand Debian.

So, what if you want to use a module that's not packaged for Debian, or you
need a more recent version?  Simple, you build the Debian package yourself.
 The advantages are much the same, and you avoid crazy conflicts where you
may have the same module installed twice with two different versions.

Building a debian package from CPAN is usually as simple as:

	dh-make-perl --build --cpan Example::Module

You can even change --build to --install if you want to speed the process.
If you don't have dh-make-perl, you can use:

	apt-get install dh-make-perl

to install it.

In this way, you can use pre-built packages for most of your modules, and
dh-make-perl packages to fill in the gaps.



Paul Fenwick <pjf at perltraining.com.au> | http://perltraining.com.au/
Director of Training                   | Ph:  +61 3 9354 6001
Perl Training Australia                | Fax: +61 3 9354 2681

More information about the Melbourne-pm mailing list