Solved pkg crashing with segfault

Hi all,
I am running FreeBSD on a HP Microserver on my LAN. At some point in the past year, I broke something and certain pkg commands no longer run, but terminate in a segmentation fault. My guess is that the ports database is corrupted, but I'm not entirely sure. I've googled the problem various times but haven't found a fix. Any ideas for me?

TIA

Code:
$ sudo pkg upgrade
Updating FreeBSD repository catalogue...
Fetching meta.txz: 100%    916 B   0.9kB/s    00:01   
Fetching packagesite.txz: 100%    6 MiB   2.2MB/s    00:03   
Processing entries: 100%
Child process pid=16623 terminated abnormally: Segmentation fault

Code:
$ pkg info pkg
pkg-1.15.4

Code:
$ uname -r
12.2-RELEASE
 
1. freebsd-update fetch install
2. pkg delete -f pkg
3. /usr/sbin/pkg
4. Test again and report back.
 
2. pkg delete -f pkg
3. /usr/sbin/pkg
pkg bootstrap -f; if the database is indeed corrupt the pkg-delete(8) is likely to fail too.

Code:
     bootstrap
             This is for compatibility with the pkg(7) bootstrapper.  If pkg
             is already installed, nothing is done.

             If invoked with the -f flag an attempt will be made to reinstall
             pkg from remote repository.

My guess is that the ports database is corrupted, but I'm not entirely sure.
What happens if you use pkg-static version -v? Does it crash too? Use pkg-static(8) to rule out any issues with libraries and such.
 
  • Like
Reactions: a6h
Back
Top