pkg segfaulting

Hi all,

On one of my systems, pkg is broken:
Code:
$ sudo pkg install upgrade
Updating FreeBSD repository catalogue...
Fetching meta.txz: 100%    944 B   0.9kB/s    00:01
Fetching packagesite.txz: 100%    6 MiB 824.1kB/s    00:08
Processing entries: 100%
Child process pid=97251 terminated abnormally: Segmentation fault
If I rerun it at this point, it runs without apparent error, but doesn't seem to find anything:
Code:
$ sudo pkg upgrade  
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking for upgrades (0 candidates): 100%
Processing candidates (0 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.
Code:
$ pkg info | wc -l
     118
Code:
$ sudo pkg install nmap
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
pkg: No packages available to install matching 'nmap' have been found in the repositories
Something must be broken here, but what?
Code:
$ ls -l /var/db/pkg
total 37816
-rw-r--r--  1 root  wheel       246 Sep  1 08:00 FreeBSD.meta
-rw-r--r--  1 root  wheel  17539072 Sep  1 08:52 local.sqlite
-rw-------  1 root  wheel  52555776 Sep  1 01:36 pkg.core
drwxr-xr-x  2 root  wheel         2 Sep  1 08:00 provides
-rw-r--r--  1 root  wheel    184320 Sep  1 08:01 repo-FreeBSD.sqlite
-rw-r--r--  1 root  wheel    184320 Sep  1 01:37 repo-FreeBSD.sqlite-pkgtemp
-r--r--r--  1 root  wheel   5841515 Aug 30 03:39 vuln.xml
Anyone have any suggestions for me?
Code:
$ uname -r
11.3-RELEASE-p3
 
pkg install upgrade doesn't make much sense, though it shouldn't lead to a segfault. pkg upgrade showing 0 packages to upgrade is normal if there's nothing to upgrade.

Finally, pkg install nmap not finding nmap package is bad, try forcefully updating the pkg database using pkg update -f.
 
Sorry, cut and paste error: meant pkg upgrade.

I try running pkg update -f three times in succession; each time it segfaults.

The weird thing is that nmap is already installed; pkg info nmap works, but pkg install nmap returns nothing.

Could this file be corrupted? /var/db/pkg/local.sqlite

Here is potential brute-force solution I haven't tried yet which comprises removing all packages and reinstalling them:
pkg segfault abort, signal 6, runs out of memory, package not installed
 
Back
Top