FreeBSD Upgrade Perl 5.8.x to 5.10.x

How do I upgrade Perl version under FreeBSD operating system?

ADVERTISEMENTS

Perl (Practical Extraction and Report Language) is a language optimized for scanning arbitrary text files, extracting information from those text files, and printing reports based on that information. It’s also a good language for many system management tasks. Perl can be easily upgrade to 5.10.1 from 5.8.x version using the following instructions.

lang/perl5.10 has been updated to 5.10.1. You should update everything that depends on perl. The easiest way to do that is to use “perl-after-upgrade” script supplied with lang/perl5.10.

Upgrade ports tree

Type the following command:
# portsnap fetch update

Upgrade Perl using portupgrade

Type the following commands:
# pkgdb -Ff
# portupgrade -o lang/perl5.10 -f perl-5.8.\*
# portupgrade -fr perl

Update all perl related stuff:
# portupgrade -f p5*

Upgrade Perl using portmaster

Type the following commands:
# portmaster -o lang/perl5.10 lang/perl5.8
# portmaster -r perl-

Notice: If the “perl-” glob matches more than one port you will need to specify the name of the perl directory in /var/db/pkg explicitly:
portmaster -Dr perl- /var/db/pkg/perl-5.10.1/

fixup FreeBSD packages that depend on perl

The standard procedure after a perl port (lang/perl5.X) upgrade is to basically reinstall all other packages that depend on perl. This is always a painful exercise. The perl-after-upgrade utility makes this process mostly unnecessary.
# perl-after-upgrade -f

Upgrade Other Packages

You also need to reinstall all other packages that depends upon perl. For example, amavisd-new. spamassassin, and clamav etc.
# cd /usr/ports/your-port-name
# make deinstall install

References:

  • Read /usr/ports/UPDATING file.
  • man pages portmaster, portupgrade, and perl-after-upgrade
🐧 If you liked this page, please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
4 comments… add one
  • Alex Libman Jan 5, 2010 @ 5:53

    I wish it worked for me as easily as that (FreeBSD 8.0-RELEASE i386): portupgrade, portmaster, and everything else I’ve tried insist that I must pkg_delete perl-5.8 first, which has way too many dependents…

    • Max Clements Oct 11, 2010 @ 5:53

      Hmm, I know this is an old thread, but you can also just alter the “conflicts with” line in the Makefile of the perl-5.10 port and life will be good, as the -o tells portupgrade to use 5.10 to upgrade 5.8 (assuming you are using portupgrade)

  • Robert Brown Aug 8, 2011 @ 1:14

    For me it required this –

    env DISABLE_CONFLICTS=1 portupgrade -o lang/perl5.14 -f perl-5.8.\*

  • Bastien Mar 9, 2012 @ 11:23

    Thanks a lot for your documentation, it help me very much to update my old 5.8 perl port to 5.12 in my Freebsd 9.0

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.