pkg 2.3.1 problem with upgrade to specific version

We test binary pkg upgrades locally before deploying them across the network by running pkg upgrade on a central machine. If a new package version does not seem to break production, we upgrade all other systems using the pkg upgrade pkg-name-version to ensure the tested version only is upgraded to.

This mechanism has stopped working since pkg itself upgrade to version 2.3.1. Pkg reports an error, stating that the package including the new version name is not installed and thus can not be upgraded to.

For example:
Code:
# pkg upgrade nginx-1.28.0_4,3
Updating FreeBSD repository catalogue...
Fetching data.pkg: 100%   10 MiB  10.5MB/s    00:01    
Processing entries: 100%
FreeBSD repository update completed. 36153 packages processed.
Updating FreeBSD-kmods repository catalogue...
FreeBSD-kmods repository is up to date.
All repositories are up to date.
pkg: nginx-1.28.0_4,3 is not installed, therefore upgrade is impossible
Checking integrity... done (0 conflicting)
Your packages are up to date.

# pkg upgrade nginx
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating FreeBSD-kmods repository catalogue...
FreeBSD-kmods repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
    nginx: 1.28.0_3,3 -> 1.28.0_4,3 [FreeBSD]

Number of packages to be upgraded: 1

568 KiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching nginx-1.28.0_4,3.pkg: 100%  568 KiB 582.1kB/s    00:01    
Checking integrity... done (0 conflicting)
[1/1] Upgrading nginx from 1.28.0_3,3 to 1.28.0_4,3...
===> Creating groups
Using existing group 'www'
===> Creating users
Using existing user 'www'
[1/1] Extracting nginx-1.28.0_4,3: 100%
You may need to manually remove /usr/local/etc/nginx/nginx.conf if it is no longer needed.

Does anyone else experience this? Has the format for doing a pkg upgrade pkg-name-version changed and the man page is outdated?

Thanks.
 
Thanks, SirDice.

That does seem to work. Install switches to upgrade automatically:
Code:
# pkg install nginx-1.28.0_4,3
Updating FreeBSD repository catalogue...
Fetching data.pkg: 100%   10 MiB  10.5MB/s    00:01    
Processing entries: 100%
FreeBSD repository update completed. 36153 packages processed.
Updating FreeBSD-kmods repository catalogue...
FreeBSD-kmods repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
    nginx: 1.28.0_3,3 -> 1.28.0_4,3 [FreeBSD]
Number of packages to be upgraded: 1
568 KiB to be downloaded.
Proceed with this action? [y/N]: y
...

Yet, we explicitly opted for pkg upgrade to avoid installing packages accidentally onto systems where they are not wanted in the course of an upgrade process. Nothing necessary, obviously, but it seemed like a good defensive strategy. Upgrade is upgrade and should not accidentally install something.

Another point that remains, is that the manual for pkg upgrade (still) mentions the pkg-name-version-format.

And it did work in pkg before version 2.3.1. So was this option deliberately removed from upgrade with pkg 2.3.1, or did something slip in pkg and it may work again in the future?
 
I never upgrade individual packages, it's always all or nothing.

I get why you'd want to test an upgrade beforehand though, I also do this. But I'll leave the "new" repository only accessible to the test servers, and when I'm satisfied "publish" it to the rest of the systems.
 
Back
Top