2011/08/24: Missing libraries during upgrade

When updating libraries, at some point you are in the situation that the library is already updated, whereas programs linking to this library are not yet. If not using binary packages, this situation might stay for quite a while (on slow machines for fundamental libraries even something like a day).

To cope with this situation, tools like portupgrade(1) preserve uninstalled libraries in a special directory, by default /usr/local/lib/compat/pkg. In that way, the libraries can still be used, while one application after the other switches to the new library version.

Normally, that all is smoothly handled by portupgrade(1) and things "just work". Today, however, while upgrading I stumbled over the error message


/libexec/ld-elf.so.1: Shared object "libicui18n.so.46" not found, required by "gio-querymodules"

It took me a while to find out what has happened, despite the reason being trivial. In the old package, libicui18n.so.46 was a symlink to libicui18n.so.46.0 and applications neverthess linked against that library name; unfortunately, when preserving the old library after update, the actual library was preserved, but the symlink was not. Once I found out that this was the origin of the problem, it was easy to change to /usr/local/lib/compat/pkg and type ln -s libicui18n.so.46 libicui18n.so.46.0.