views:

805

answers:

4

I upgraded to Ubuntu Intrepid Ibex yesterday and suddenly some of the Perl modules that I installed (on the Hardy Heron) have all gone missing!

I get the usual "Can't locate module in @INC" error. Has any of the CPAN repositories changed or something for Intrepid? Google doesn't help at all.

Thanks in advance.

+4  A: 

Perl changed on Intrepid.

Before upgrading, you had Perl 5.8, now you have 5.10.

innaM
+1  A: 

Probably /usr/lib/perl5/5.10.* is used instead of /usr/lib/perl5/5.8.8 since the Perl version has changed

Sudden Def
The other way around. The modules he has installed are in /usr/lib/perl5/5.8.8 and perl's now looking in /usr/lib/perl5/5.10.0
Vinko Vrsalovic
+6  A: 

The standard solution is to generate an "autobundle" with CPAN.pm before upgrading Perl. A search for autobundle yields links to a handful of existing SO questions discussing Perl module management and several that look like they should provide more information. The CPAN.pm manual touches on autobundle, but doesn't include much detail.

Since you've already upgraded Perl, one solution for installing your modules would be to generate an autobundle file and use the entries in the generated file as a guide to write a custom autobundle file with entries for your modules (only). The autobundle file format is just POD, so this should be easy to do.

In the future you should probably make it a habit to generate an autobundle before upgrading Perl. This is not a perfect solution, the autobundle will include entries for core modules that will have to be removed before actually building from it, but at least you'll have a snapshot of installed Perl modules so that you can get your Perl install fixed up after an upgrade.

converter42
To make an autobundle, find the old perl binary and use it to run the cpan command with the -a switch (i.e. /usr/local/bin/perl5.8.5 cpan -a).
brian d foy
+4  A: 

Your Perl installation has changed from version 5.8 to 5.10. Since many of the modules you want are in perl-version-specific directories, you may want to re-install using the CPAN tools (e.g. the cpan command).

But since you're using Ubuntu, please keep in mind that many many CPAN libraries are also distributed through the Ubuntu package manager, and the CPAN packages install into a different place than Ubuntu installs them (this is transparent to the user, since both are in the @INC paths).

I recommend using the Ubuntu packages when they're available, because they will be updated by the package manager (APT) when new ones are released on the central package servers. The name format is slightly different. Here are two ways to install the same package, from different sources:

$ cpan List::MoreUtils # installs latest from CPAN

$ sudo apt-get install liblist-moreutils-perl # installs latest from Ubuntu universe

the advantage of the latter is that it will be updated by sudo apt-get update.

Trochee