I'm using FreeBSD 12-CURRENT and recently I tried to update my packages with
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?
pkg bootstrap -f(or
pkg install -f pkg).
pkg-static bootstrap -f(or
pkg-static install -f pkg) as it doesn't require any shared objects.
If everything else doesn't work then you can install
pkg from ports:
cd /usr/ports/ports-mgmt/pkg make make reinstall clean
You should be able to use
Also, remember that there are two programs called
pkg in FreeBSD. See
man 7 pkg and
man 8 pkg for more details.