Ubuntu 12.04 is out, and I want to upgrade. However, I need to conserve my existing perl 5.12 installation before upgrading. On 12.04, there is perl 5.14 and I would need to reinstall lots of perl modules. I better copy my existing perl installation before ugrading, because the installer will remove the old perl stuff and I cannot determine what I need when the 5.12 modules are gone.
Any ideas how to do this? I have a mix of modules installed from repos, from cpanm, from cpan, and from source. I need
- a strategy to determine a comprehensive list of my perl modules, their respective origins
- a sequence in which order to proceed.
- advice on what to do in case a certain module is not yet available in 5.14.
- advice on which environment variables and paths to change.
I would recommend breaking this question up into several parts in order to simplify the responses.
My suggestions below are only a rough outline of my previous migration experiences. I would recommend that you follow up with additional reading.
Develop a strategy to determine a comprehensive list of my Perl modules, and their respective origins
There are several methods of determining which Perl modules are installed on your system.
The following command:
will list all perl modules including those installed by the default package.
There are two other commands that can simplify the list to include manually installed modules:
The command
perldoc perllocal
will list some details about the modules version and their installed location.Another command is
sudo instmodsh
. which will provide a simple list of installed modules.There are other questions posted here that may help determine whether your module is part of the core distribution or not.
Build a migration plan to determine the order to proceed with the migration.
I would recommend using Perl's
autobundle
option to create a snapshot of your installed modules using the command:perl -MCPAN -e 'autobundle'
The final output will be something like this:
wrote bundle file /home/somerandomuser/.cpan/Bundle/Snapshot_2012_11_13_00.pm
Be sure to make a note of that file as you will need it to restore the snapshot later when issuing the next command after your system upgrade:
Advice on what to do in case a certain module is not yet available in 5.14.
Read about the different modules on CPAN and their availability in new Perl releases.
Finally, and most importantly, I would highly recommend installing Perlbrew and TEST. TEST. TEST. My instructions are not meant to be taken as a step-by-step failproof installation guideline but a rough outline of the process
I hope that this points you in the right direction.