"pkg upgrade" issue encountered & resolved: "Repository ... has a wrong packagesite, need to re-create database"

David Wolfskill david at catwhisker.org
Sun Oct 9 20:38:14 UTC 2016

For my "production" machines at home, I build FreeBSD (from sources) and
build packages (from ports) on a dedicated "build machine," then install
onto the production machines, as described in

In preparation for the stable/10 -> stable/11 migration, I had restored
backup images from one of the production machines ("albert") to a very
similar machine, then changed /etc/rc.conf to reflect a different IP
address and hostname ("pogo").  I had verified that it worked, then
tried performing a "normal" (stable/10 -> stablbe/10) update to it; when
that worked, I then updated its installed packages; that also worked.

Then I tried updating from stable/10 -> stable/11 -- which worked.  And
I then made a list of the installed packages, blew away all of them,
then installed the lot (from my local repository).  And that worked.

Well, that was about a month ago (05 Sep).  So this morning, I thought
it was time to refresh things a bit.

I first refreshed the stable/11  FreeBSD base, going from:

FreeBSD pogo.catwhisker.org 11.0-PRERELEASE FreeBSD 11.0-PRERELEASE #51  r305404M/305415:1100502: Mon Sep  5 04:22:27 PDT 2016     root at freebeast.catwhisker.org:/common/S3/obj/usr/src/sys/ALBERT  amd64


FreeBSD pogo.catwhisker.org 11.0-PRERELEASE FreeBSD 11.0-PRERELEASE #82  r306879M/306902:1100503: Sun Oct  9 06:34:36 PDT 2016     root at freebeast.catwhisker.org:/common/S3/obj/usr/src/sys/ALBERT  amd64

On reboot, things seemed OK, so I started the package update, only to
get a whine:

Repository custom has a wrong packagesite, need to re-create database

after which the machine rebooted.  No messages in /var/log; the
machine doesn't have a console, and I was running it headless.

I tried a couple more times, while running other things to try to
find out what was happening.  (One time, I ran top(1), and it
provided a hint that something was using a lot of CPU just before
the reboot.)

But other than that (CPU usage), I had no clue.

I poked around a bit on the Net, to no avail.

Finally, I checked which version of pkg I had on my more-recently-updated
systems (pkg-1.8.7_3) vs. what was install on pogo (pkg-1.8.7_1)
and figured I'd try updating pkg first.

My first attempt ("pkg upgrade ports-mgmt/pkg") failed the same as the
other "pkg upgrade" attempts did, so then I:

pkg delete -f ports-mgmt/pkg

which worked, then

pkg bootstrap

which also worked (and even picked it up from my local repository, as

I then verified that pkg claimed to be pkg-1.8.7_3, then tried "pkg
upgrade" again.

Success!  :-)

Checking integrity... done (0 conflicting)
The following 103 package(s) will be affected (of 0 checked):

Installed packages to be REMOVED:

New packages to be INSTALLED:

Installed packages to be UPGRADED:
        xterm: 325 -> 327
        x264: 0.144.2533_3 -> 0.148.2708
        bind99: 9.9.9P2_1 -> 9.9.9P3
        bash: 4.3.46_1 -> 4.4

Installed packages to be REINSTALLED:
        webp-0.5.0 (needed shared library changed)
        nspluginwrapper-1.4.4_5 (direct dependency changed: libX11)
        linux-c6-xorg-libs-7.4_5 (direct dependency changed: linux-c6-fontconfig)
        linux-c6-dri-11.0.7 (direct dependency changed: linux-c6-xorg-libs)
        linux-c6-cups-libs-1.4.2_5 (direct dependency changed: linux-c6-gnutls)
        linux-c6-alsa-plugins-oss-1.1.0 (direct dependency changed: linux-c6-alsa-lib)

Number of packages to be removed: 1
Number of packages to be installed: 1
Number of packages to be upgraded: 84
Number of packages to be reinstalled: 17

The operation will free 20 MiB.

Proceed with this action? [y/N]: y

Anyway, I thought I'd post about it in case anyone else needed hint.

David H. Wolfskill				david at catwhisker.org
Those who would murder in the name of God or prophet are blasphemous cowards.

See http://www.catwhisker.org/~david/publickey.gpg for my public key.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 603 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20161009/f7988eaa/attachment.sig>

More information about the freebsd-ports mailing list