Recently I’ve been trying to update the perl package on my FreeBSD box to the latest version 5.18 without any success. Here’s a snippet of the error message:
Creating various symlinks in /usr/bin... Symlinking /usr/local/bin/perl5.18.1 to /usr/bin/perl Symlinking /usr/local/bin/perl5.18.1 to /usr/bin/perl5 Done. Installing perl5.18-5.18.1_2...pkg-static: perl5.18-5.18.1_2 conflicts with perl-5.12.5 (installs files into the same place). Problematic file: /usr/local/bin/a2p *** [fake-pkg] Error code 70 Stop in /usr/ports/lang/perl5.18. *** [install] Error code 1 Stop in /usr/ports/lang/perl5.18. ===>>> Installation of perl5.18-5.18.1_2 (lang/perl5.18) failed ===>>> Aborting update ===>>> Killing background jobs Terminated ===>>> You can restart from the point of failure with this command line: portmaster lang/perl5.18 ===>>> Exiting
So I turned to Google to see if other people experienced the same thing as me. According to an answer to a similar question about upgrading perl on serverfault.com, one should read
Let’s do it.
pkg updating | less
20131023: AFFECTS: users of lang/perl5.12 lang/perl5.14 AUTHOR: mat@FreeBSD.org The default perl has been switched to lang/perl5.16. If you're using binary packages, you need to do : # pkg set -o lang/perl5.14:lang/perl5.16 If you're not using binary packages and want to (and should) switch, if you're using perl-5.14, for instance : Portupgrade users: 0) Fix pkgdb.db (for safety): pkgdb -Ff 1) Reinstall new version of Perl (5.16): portupgrade -o lang/perl5.16 -f perl-5.14.\* 2) Reinstall everything that depends on Perl: portupgrade -fr perl Portmaster users: portmaster -o lang/perl5.16 lang/perl5.14 Conservative: portmaster p5- Comprehensive (but perhaps overkill): portmaster -r perl- Note: 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.
I’m using Portmaster, and I’d like to upgrade from perl5.12 to perl5.18.
# portmaster -o lang/perl5.18 lang/perl5.12
…and after a very long wait, this was the result:
===>>> Updating dependency entry for perl5.18-5.18.1_2 in each dependent port ===>>> Delete perl/perl-5.16.3.tar.bz2? y/n [n] y ===>>> Delete old and new distfiles for lang/perl5.12 without prompting? y/n [n] y ===>>> Installation of lang/perl5.18 (perl5.18-5.18.1_2) complete ===>>> Exiting
There you go. If there’s only thing you can take from this post is that if you upgrade packages from sources very often on FreeBSD, you really should check the /usr/ports/UPDATING.