How to recover after Perl upgrade on FreeBSD

I wrote some time ago (nhw.pl/blg/archives/2006/03/30/T10_33_03 about troubles with Perl applications installed via FreeBSD ports after Perl was upgraded itself. So I run on similar problem again (this time reinstall was enough). But here You have detailed procedure how to get rid off /libexec/ld-elf.so.1: Shared object “libperl.so” not found, required by “perl” message. If not will be useful for You for sure I will need it some future :))

So, lets start from a bit background. What went wrong? Theoretically Perl upgrade on FreeBSD box should be as following:

  • portupgrade perl
  • perl-after-upgrade

UPDATE 2006-05-08
I’ve just read perl-after-upgrade manual. Drat and double drat! It needs to be run with -f switch to do actual work. Without options it is test run, not changing anything. So, next time I will try to run it properly… I suppose it won’t be any “libperl missing” anymore… So You (I) may not need following procedure ;))
UPDATE END

And this sholud be OK. But after that I’ve got /libexec/ld-elf.so.1: Shared object “libperl.so” not found, required by “perl” when running snmpd. Don’t know why but some Perl modules were still in old place (in my case /usr/local/lib/perl5/site_perl/5.8.7). And this modules were looking for libperl in /usr/local/lib/perl5/5.8.7/mach/CORE/, what was wrong since one and only true :) libperl was in /usr/local/lib/perl5/5.8.8/mach/CORE/.

So how to recover? Lets assume we are migrating from 5.8.7 to 5.8.8. Upgrade starts with portupgrade perl and perl-after-upgrade. If something is wrong run following code:


portupgrade -f `(pkg_info -R perl-5.8.7 |tail +4; \
find /usr/local/lib/perl5/site_perl/5.8. \
type f -print0 | xargs -0 pkg_which \
-fv | sed -e '/: ?/d' -e 's/.*: //')|sort -u`

After that all p5-* packages should be brand new in proper place. So You can remove /usr/local/lib/perl5/site_perl/5.8.7/ (You have backup of course, do You? :)) ) When upgrading from other Perl version, replace 5.8.7 with proper directory.

DISCLAIMER of course it have worked for me, but You are on Your own :))

Join the Conversation

1 Comment

  1. Pingback: dev/n0ll

Leave a comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.