I'm using FreeBSD 12-CURRENT and recently I tried to update my packages with pkg.

pkg update finished successfully, but pkg upgrade returned the following error:

Shared object "libarchive.so.5" not found, required by "pkg"

What should I do?

  1. First of all, try pkg bootstrap -f (or pkg install -f pkg).
  2. If it fails then try pkg-static bootstrap -f (or pkg-static install -f pkg) as it doesn't require any shared objects.
  3. If everything else doesn't work then you can install pkg from ports:

    cd /usr/ports/ports-mgmt/pkg
    make reinstall clean

You should be able to use pkg now.

Also, remember that there are two programs called pkg in FreeBSD. See man 7 pkg and man 8 pkg for more details.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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