FreeBSD 9: Shared Object “libutil.so.8” not Found

Problem

After upgrading to FreeBSD 9, whenever I try to use ports to install something, I will get following error:

$ cd /usr/ports
$ make search name=nano
The search target requires INDEX-9. Please run make index or make fetchindex.

Then, I whenever I run make index command, it will prompt following error:

$ cd /usr/ports
$ make index
Generating INDEX-9 - please wait.. Shared object "libutil.so.8" not found, required by "perl ""Makefile". line 29: warning "/usr/local/bin/perl -V::usethreads" returned non-zero status

What happen?

During FreeBSD upgrade from version 8.2 to the new release 9.0, it seems like FreeBSD has deleted the old library after the second time of freebsd-update install command execution. This is usually happen when you are doing major release version upgrade.

Solution

We need to create symlink to the new libutil.so for FreeBSD 9 under /lib directory:

$ cd /lib
$ ln -s libutil.so.9 libutil.so.8

Then we need to run again to “make index” command. Make index will create the index (which then use for us to lookup ports collection) by looking at your current ports tree:

$ cd /usr/ports
$ make index
Generating INDEX-9 - please wait.. Done.

Now you should able to use ports as usual. Cheers!