secJ
secJ

Reputation: 509

In-place Perl upgrade from source

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)).

Upvotes: 10

Views: 637

Answers (2)

Alexander Hartmaier
Alexander Hartmaier

Reputation: 2204

If you are using perlbrew it has an 'upgrade-perl' command. The downside is that the initial configure parameters still aren't passed to the newly built version. See also http://www.modernperlbooks.com/mt/2013/03/upgrade-in-place-with-perlbrew.html

Upvotes: 0

melpomene
melpomene

Reputation: 85887

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.

Upvotes: 3

Related Questions