I am running a hand full of servers and in the past I have build and installed all the ports on each server individually. As some of them are not so powerful I have create a kind of an unusual setup to build packages only on the most powerful server. The packages are stored in the NFS shared /usr/ports/packages/All/ directory. My workflow is like this: 1) on all servers I run (at the same time): cd /usr/ports/ && nice -n 5 make update && nice -n 5 make fetchindex && nice -n 5 portupgrade -an 2) on the build server I run: nice -n 5 portupgrade -ap and then an own script to remove outdated packages, create .txz link to .pkg and also run: pkg repo /usr/ports/packages 3) on all other server then I run: nice -n 5 portupgrade -akP As not all ports are installed on the build server, other servers will build the port locally (mostly small stuff which does not need a lot to build). With the use of 'portupgrade -P' ports installed from packages are done with 'pkg', but when the port is build locally, then 'pkg-static' is used (as it also is the case when -P is not used). With an update of ports-mgmt/pkg on the build server it gets build and a package is created and stored in /usr/ports/packages/All/. But then on the other server the installation fails as the installed ports-mgmt/pkg gets removed and pkg is not there any more to install. Why is 'portupgrade -P' using 'pkg' instead of 'pkg-static' to upgrade from a packages? My workaround currently is like this (needs to be done before running 'portupgrade -akP'): pkg install /usr/ports/packages/All/pkg-1.19.1_1.pkg I am aware that I could create a proper build environment with a jail and poudriere, but what I currently have works fine for my use case. My next improvements will be to also use a NFS share for /usr/ports/ (to only run 'make update' and 'make fetchindex' on one server) and /var/db/ports/ and use something like 'WRKDIRPREFIX=/path/to/ports-workdir portupgrade' to avoid building over NFS.
While I don't know whether this is a genuine bug or not, but as mentioned in the other ticket I recommend doing this with poudriere, then you can upgrade with "pkg upgrade". Done.
pkg and pkg-static both belong to the pkg package, so using either won't change anything if I am understanding this correctly.
I remove pkg@ from cc as this has nothing to do with pkg itself.
(In reply to Baptiste Daroussin from comment #2) Running on the build system (where the port is build from source) with: portupgrade -pa this gets logged into syslog: Sep 22 20:15:42 riddler pkg[59460]: webp-1.3.1_1 deinstalled Sep 22 20:15:44 riddler pkg-static[59708]: webp-1.3.2 installed And running on any of the other systems (where an available pre-built package is taken) with: portupgrade -kPa this gets logged into syslog: Sep 22 20:44:48 batman pkg[4699]: webp-1.3.1_1 deinstalled Sep 22 20:44:49 batman pkg[4728]: webp-1.3.2 installed Usually this does not make a difference, unless there is an update for ports-mgmt/pkg itself. On the build system it works just fine, but then fails on the other systems and leaves them in a broken state where ports-mgmt/pkg is removed. The only way out of this is with a local manual build like this: cd /usr/ports/ports-mgmt/pkg make install So my (slightly rewritten) question from the original report still stands: Why is 'portupgrade -P' using 'pkg' instead of 'pkg-static' when upgrading from a package instead of a locally done build? Some other thoughts, could it be that portupgrade is taking different steps / commands when run with -P during install from a local build or a package? So what I see in syslog with the 'pkg' and 'pkg-static' is just a coincident?