Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just updated my FreeBSD from 9.x to 10.0 (using freebsd-update) and now my pkg isn't working.

# pkg
Shared object "" not found, required by "pkg"

I know I can use pkg-static meanwhile, but how do I fix my pkg now?


# pkg-static  info pkg
pkg-static: No package(s) matching pkg
# pkg-static install pkg
Updating repository catalogue
pkg-static: Not Found
share|improve this question
Did you rebuild all your ports, e.g. portmaster -af? – Michael Hampton Feb 15 '14 at 20:33
when I try doing that, I get : /usr/local/sbin/portmaster: pkg_version: not found – alexus Feb 15 '14 at 20:35
Well now I have to wonder if you ever properly converted to pkgng? – Michael Hampton Feb 15 '14 at 20:36
I just used freebsd-update fetch & install && reboot – alexus Feb 15 '14 at 20:37
(upstream portmaster maintainer here) Sounds like a portmaster bug there. It runs 'pkg info pkg' to see if pkg is installed, and since it is erroring due to the shared lib then it thinks pkg is not installed and uses the old pkg_*. I will try to address that. – Bryan Drewery Feb 15 '14 at 21:07
up vote 0 down vote accepted

Here's what fixed my FreeBSD 9.2-RELEASE -> 10.0-RELEASE update which had the identical issue Shared object "" not found required by "pkg", though my pkg-static pkg showed 1.2.6 was installed.

# pkg-static bootstrap -f

Which listed instructions for boot strapping pkg

# pkg-static delete -f pkg
# /usr/sbin/pkg -v

Afterwards pkg seems to behave correctly.

share|improve this answer
pkg-static: 'bootstrap' is not a valid command. – alexus Feb 24 '14 at 15:58
I still get: pkg-static boostrap pkg(8) already installed, use -f to force. – Rob Paisley Feb 24 '14 at 17:11


  1. Rebuild pkg from ports:

    cd /usr/ports/ports-mgmt/pkg && make deinstall reinstall clean
  2. Fix the library link via libmap.conf:

    echo " `ls /usr/lib/*`" >> /etc/libmap.conf

    There might be other apps that this fixes the same issue. pkg also relies on 8 other shared libraries. I'm not sure which changed between 9.x and 10.x, but I'd bet there will be others.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.