Senin, 01 Januari 2007

Recovering from a Bad FreeBSD Package

Previously for this blog I've described my reliance on precompiled FreeBSD packages, rather than building everything from source. Today that tendency bit me. I tried to run Thunderbird and Firefox after updating my packages and saw the following errors.


orr:/home/richard$ thunderbird
/libexec/ld-elf.so.1: /usr/local/lib/libplds4.so.1: Undefined symbol
"gethostbyname_r"
orr:/home/richard$ firefox
/libexec/ld-elf.so.1: /usr/local/lib/libplds4.so.1: Undefined symbol
"gethostbyname_r"

That's a pain, since researching the problem without Firefox could be clumsy. Luckily (or unluckily) I remembered encountering this exact problem earlier. This may indicate a problem that needs to be fixed on the package building systems, but I can show you how to recover.

First I figured out where /usr/local/lib/libplds4.so.1 originated.

orr:/var/db/pkg$ grep -R plds *
nspr-4.6.3_1/+CONTENTS:lib/libplds4.a
nspr-4.6.3_1/+CONTENTS:lib/libplds4.so
nspr-4.6.3_1/+CONTENTS:lib/libplds4.so.1
Binary file pkgdb.db matches

So, libplds4.so.1 was installed by nspr-4.6.3_1. Let me check my log of my ports upgrade to see what happened.

---> Found a package of 'devel/nspr': /usr/ports/packages/All/nspr-4.6.3.tbz
(nspr-4.6.3)
---> Fetching the package(s) for 'nspr-4.6.4' (devel/nspr)
---> Fetching nspr-4.6.4
++ Will try the following sites in the order named:
ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6-stable/
...edited...
---> Fetching the latest package(s) for 'nspr' (devel/nspr)
---> Fetching nspr
++ Will try the following sites in the order named:
ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6-stable/
---> Invoking a command: /usr/bin/fetch -o '/var/tmp/portupgradeTcYEJHAt/nspr.tbz'
'ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6-stable/Latest/nspr.tbz'
/var/tmp/portupgradeTcYEJHAt/nspr.tbz 0% of 422 kB 0 Bps
---> Downloaded as nspr.tbz
---> Identifying the package /var/tmp/portupgradeTcYEJHAt/nspr.tbz
---> Saved as /usr/ports/packages/All/nspr-4.6.3_1.tbz
---> Listing the results (+:done / -:ignored / *:skipped / !:failed)
+ nspr@
---> Packages processed: 1 done, 0 ignored, 0 skipped and 0 failed
---> Found a package of 'devel/nspr': /usr/ports/packages/All/nspr-4.6.3_1.tbz
(nspr-4.6.3_1)
---> Located a package version 4.6.3_1 (/usr/ports/packages/All/nspr-4.6.3_1.tbz)
---> Using it anyway although it is not the latest version (4.6.4), since -PP/-
-use-packages-only is specified
---> Upgrade of devel/nspr started at: Mon, 01 Jan 2007 22:36:18 -0500
---> Upgrading 'nspr-4.6.3' to 'nspr-4.6.3_1' (devel/nspr) using a package
---> Updating dependency info
---> Modifying /var/db/pkg/firefox-1.5.0.7,1/+CONTENTS
---> Modifying /var/db/pkg/gaim-1.5.0_8/+CONTENTS
---> Modifying /var/db/pkg/nss-3.11.3/+CONTENTS
---> Modifying /var/db/pkg/thunderbird-1.5.0.7/+CONTENTS
---> Modifying /var/db/pkg/thunderbird-enigmail-0.94.1/+CONTENTS
---> Uninstallation of nspr-4.6.3 started at: Mon, 01 Jan 2007 22:36:25 -0500
---> Fixing up dependencies before creating a package
---> Backing up the old version
---> Uninstalling the old version
---> Deinstalling 'nspr-4.6.3'
---> Preserving /usr/local/lib/libnspr4.so.1 as /usr/local/lib/compat/pkg/libnspr4.so.1
---> Preserving /usr/local/lib/libplc4.so.1 as /usr/local/lib/compat/pkg/libplc4.so.1
---> Preserving /usr/local/lib/libplds4.so.1 as /usr/local/lib/compat/pkg/libplds4.so.1
pkg_delete: package 'nspr-4.6.3' is required by these other packages
and may not be deinstalled (but I'll delete it anyway):
firefox-1.5.0.7,1
nss-3.11.3
thunderbird-1.5.0.7
thunderbird-enigmail-0.94.1
pkg_delete: '/usr/local/lib/libplds4.so.1' fails original MD5 checksum -
deleted anyway.
[Updating the pkgdb in /var/db/pkg ... - 200 packages
found (-1 +0) (...) done]
---> Uninstallation of nspr-4.6.3 ended at: Mon, 01 Jan 2007 22:37:07 -0500
(consumed 00:00:42)
---> Installation of nspr-4.6.3_1 started at: Mon, 01 Jan 2007 22:37:08 -0500
---> Installing the new version via the package
---> Removing temporary files and directories
---> Removing old package'
---> Installation of nspr-4.6.3_1 ended at: Mon, 01 Jan 2007 22:37:11 -0500
(consumed 00:00:03)
---> Cleaning out obsolete shared libraries
[Updating the pkgdb in /var/db/pkg ... - 201 packages found
(-0 +1) . done]
---> Upgrade of devel/nspr ended at: Mon, 01 Jan 2007 22:37:17 -0500
(consumed 00:00:59)

Sure enough, nspr was updated to something that was broken. Let's fix that by removing the new version and reinstalling it via our own ports tree.

orr:/var/db/pkg# pkg_deinstall -f nspr-4.6.3_1/
---> Deinstalling 'nspr-4.6.3_1'
pkg_delete: package 'nspr-4.6.3_1' is required by these other packages
and may not be deinstalled (but I'll delete it anyway):
firefox-1.5.0.7,1
nss-3.11.3
thunderbird-1.5.0.7
thunderbird-enigmail-0.94.1
[Updating the pkgdb in /var/db/pkg ... - 200 packages found (-1 +0) (...) done]

Now find out where nspr lives, and build it.

orr:/var/db/pkg# cd /usr/ports
orr:/usr/ports# make search name=nspr
Port: nspr-4.6.4
Path: /usr/ports/devel/nspr
Info: A platform-neutral API for system level and libc like functions
Maint: gnome@FreeBSD.org
B-deps: gettext-0.14.5_2 gmake-3.81_1 libiconv-1.9.2_2
R-deps:
WWW: http://www.mozilla.org/projects/nspr/index.html

orr:/usr/ports# cd /usr/ports/devel/nspr
orr:/usr/ports/devel/nspr# make
=> nspr-4.6.4.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch from http://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.6.4/src/.
...edited...
orr:/usr/ports/devel/nspr# make install

When finished, Thunderbird and Firefox are fine.

0 komentar:

Posting Komentar