Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In-place Perl upgrade from source

Tags:

perl

Is there a standard way to upgrade to a new, minor version (and binary compatible) of Perl without a full recompile from source?

For example, if I have Perl v5.24.0 installed with a bunch of CPAN modules, can I upgrade this installation to v5.24.1 without recompiling a whole new build and doing the same for all of the CPAN modules installed under v5.24.0? Or do I have to create a list of all installed CPAN modules, compile a new Perl, and reinstall those CPAN modules using the newly compiled version?

I'm not seeing an easy way to "patch" the current system, using the source code from the latest release. (Note: I'm wondering if there is a native way to do this (i.e., not using perlbrew)).

like image 861
secJ Avatar asked Apr 24 '17 22:04

secJ


1 Answers

if I have Perl v5.24.0 installed with a bunch of CPAN modules, can I upgrade this installation to v5.24.1 without recompiling a whole new build

As far as I know, no. You have to configure/compile/install the new perl from scratch.

and doing the same for all of the CPAN modules installed under v5.24.0?

Yes: Configure asks you about existing perl versions and whether it should include their directories in @INC. If you say yes (which I believe is the default), all already installed modules are available in your new perl.


That said:

Or do I have to create a list of all installed CPAN modules

This is easy with cpan -a:

$ cpan -a
... lots of modules listed here ...

Wrote bundle file
    /home/user/.cpan/Bundle/Snapshot_2017_04_25_00.pm

and reinstall those CPAN modules using the newly compiled version?

After installing the new Perl, run

$ cpan Bundle::Snapshot_2017_04_25_00

(or whatever name cpan -a gave the snapshot file in the previous step) and it should install everything you had before.

like image 107
melpomene Avatar answered Oct 15 '22 13:10

melpomene