Skip to content

Test CPANPLUS install on a Debian system

November 5, 2010


I’m a Perl author working on a Debian unstable system. The great thing about Debian is that a lot of Perl modules are available though Debian packages. I follow Debian way of life to the point that I no longer install my modules (under development) with ‘sudo make install’ (or its Module::Build equivalent).

I’ve often been bitten by weird test errors due to old version of module lingering in /usr/local. Now, I always create Debian package of my modules under development with dh-make-perl.

This way, I avoid installing Perl module in /usr/local and my developement versions are cleaned up when actual package are availalble through Debian unstable. ()

This method has an unfortunate side effect: I never test installation the CPAN way. And Config::Model did fail to install with CPANPLUS.

Now here’s a way to create a barebone Debian chroot with cowbuilder to test CPANPLUS installation.

First create a new chroot:

$ sudo cowbuilder --create --distribution sid

Loging into this chroot (the bindmount option is necessary for cpanp to work correctly) :

$ sudo cowbuilder --login --bindmounts /dev

In the chroot:

Run cpan to configure CPAN:

# cpan

Hit return to configure CPAN automatically.

Then install your module:

# cpanp i Config::Model

Or, if your module is not yet uploaded:

# cpanp i http://<path-to-tar.gz&gt;

Once you quit, the chroot is restored to its barebone state.

Et voila. I tested full installation with dependencies the CPAN way without mucking up my system.

Many thanks to Christian Kuelker of Cipux project for his comments that enable me to improve Config::Model

All the best


From → Debian, Perl

  1. No need to –bindmount /dev actually, that’s default.

    • Weird. I first tried without the –bindmount option and cpan shell did not work correctly, as if somebody was typing madly at the keyboard. With the option, I can use cpan shell as usual.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: