Thursday, 27 December 2007

Getting FreeBSD libaries in one line

Libraries are common practice these days, but maintaining them is sometimes a bit problematic. FreeBSD has some beautiful tools to fix this. One of them is portupgrade.

So let's review it:


[rick@traffie] /lib $ sudo portsclean -LL
** You have multiple versions of libgpg-error but 1 of them are not from packages:
gpg-error.3 (/usr/local/lib/libgpg-error.so.3) <- ?
gpg-error.0 (/usr/local/lib/libgpg-error.so.0) <- libgpg-error-1.5
and the symlink (/usr/local/lib/libgpg-error.so) points to:
gpg-error.0 (/usr/local/lib/libgpg-error.so.0) <- libgpg-error-1.5
--> Skipping gpg-error.3 because it is newer than what the packages provide


Ok we have a problem, let's see who did install the files in the first place

[rick@traffie] /lib $ sudo pkg_info -W /usr/local/lib/libgpg-error.so.0
/usr/local/lib/libgpg-error.so.0 was installed by package libgpg-error-1.5
[rick@traffie] /lib $ sudo pkg_info -W /usr/local/lib/libgpg-error.so.3

Thats odd one of the files was linked by any package anymore, as we are all humans there might be a bugs somewhere.
Lets check wether the files really differ:

[rick@traffie] /lib $ md5 /usr/local/lib/libgpg-error.so.{0,3}
MD5 (/usr/local/lib/libgpg-error.so.0) = 3fecd10d408cacc034d767d19465784b
MD5 (/usr/local/lib/libgpg-error.so.3) = 8259f0206df08b699bae266a12b99d20

They are, might be a forgotten removed file then?

[rick@traffie] ~ $ find /usr/ports/ -name pkg-plist -exec grep -Hn libgpg-error.so {} \+
/usr/ports/security/libgpg-error/pkg-plist:7:lib/libgpg-error.so
/usr/ports/security/libgpg-error/pkg-plist:8:lib/libgpg-error.so.0

Nah, no luck only the installed package libgpg-error. So the final but dangerous -meaning not, no really not! to be tried on a mission critical system- let's remove/rename it :-)
sudo mv  /usr/local/lib/libgpg-error.so.3 /root/


Watch your logs for over a week to spot any weird errors.




If you have many multiple dependencies problems and one of then which references to /usr/X11R6 and you 'recently' updated Xorg please alter /etc/rc.conf and include

ldconfig_paths="/usr/lib/compat /usr/local/lib \
/usr/local/lib/compat/pkg"
ldconfig_paths_aout="/usr/lib/compat/aout /usr/local/lib/aout"

and rerun /etc/rc.d/ldconfig and /etc/rc.d/ldconfig_compat

No comments:

Post a Comment