FreeBSD Administration

Upgrading Perl from the Ports Collection

Upgrading perl has always been a difficult task. As with other large projects or software packages, it can have a large number of modules or libraries installed that you are using.  All these modules have to be re-installed again after Perl is installed.  This is not really hard but it is always a chore to find and/or remember all the modules you had installed, go find the port for them, and then make sure to reinstall them after. Every time I upgraded perl there was always one or two modules that I missed and I would find out about it a week or to later when I noticed a script failing.

Here is how I now do the Per upgrade.  This upgrade required the ports-mgmt/portupgrade port installed.

# find /usr/local/lib/perl5/{site_perl/5.8.8,5.8.8} -type f -print0 | \
    xargs -0 -n 1 pkg_info -Q -W | sort -u > /tmp/perl-ports

The above line assumes that you had perl 5.8.8 installed.  Change the 5.8.8 in the above line to reflect what ever perl version is currently installed.

# vi /tmp/perl-ports

Check over the ports listed in perl-ports just to make sure it all looks good before going on to the next step.

# portupgrade perl
# portupgrade -f `cat /tmp/perl-ports`

Leave a Comment

Your email address will not be published. Required fields are marked *