Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

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

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

* UPDATE *:

# pkg-static  info pkg
pkg-static: No package(s) matching pkg
# pkg-static install pkg
Updating repository catalogue
pkg-static: http://pkg.freebsd.org/freebsd:10:x86:64/latest/repo.txz: Not Found
# 
share|improve this question
    
Did you rebuild all your ports, e.g. portmaster -af? –  Michael Hampton Feb 15 at 20:33
    
when I try doing that, I get : /usr/local/sbin/portmaster: pkg_version: not found –  alexus Feb 15 at 20:35
    
Well now I have to wonder if you ever properly converted to pkgng? –  Michael Hampton Feb 15 at 20:36
    
I just used freebsd-update fetch & install && reboot –  alexus Feb 15 at 20:37
4  
(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 at 21:07

2 Answers 2

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 "libarchive.so.5" 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 at 15:58
    
I still get: pkg-static boostrap pkg(8) already installed, use -f to force. –  Rob Paisley Feb 24 at 17:11

Options:

  1. Rebuild pkg from ports:

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

    echo "libarchive.so.5 `ls /usr/lib/libarchive.so.*`" >> /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

 
discard

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.