NetManiac

Witold Rugowski on web20 wave with Ruby on Rails

How to recover after Perl upgrade on FreeBSD

Posted on May 7, 2006 - Filed Under 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:

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

Popularity: 4% [?]

Hits for this post: 5197

Similar Posts

Comments

One Response to “How to recover after Perl upgrade on FreeBSD”

  1. dev/n0ll on May 18th, 2010 22:28

    Kramer auto Pingback[...] A quick search on Google and I found the solution too that as well. This had probably nothing to do with the upgrade from 7.0-RELEASE to 7.1-RELEASE, but perl it self. If I’m not mistaking, I upgrade all ports (including perl) just before I started the upgrade to 7.1. I found the solution over at NetManiac. [...]

Leave a Reply