This behavior is not what is outlined in the manpage. This has changed in the last few months (or longer, not sure exactly) as I used to be able to invoke this via Ansible and the pkg upgrade process would skip hosts where the package was not installed. Now, if adding "-y" all hosts will receive the new package even if it previously did not exist. pkg-upgrade(8)"... Moreover, pkg upgrade will not install new packages, except as required to fulfil dependencies of the packages listed on the command line..."
This becomes a problem when calling the following command from Ansible: `pkg upgrade -y [pkg name]` As this will now install the missing package(s) instead of only upgrading existing packages. Example command invocation directly on a test server (FreeBSD 13.1-RELEASE-p3 GENERIC amd64): (pts/4)[root@server1:~]# pkg info nginx pkg: No package(s) matching nginx (pts/4)[root@server1:~]# pkg upgrade nginx Updating FreeBSD repository catalogue... FreeBSD repository is up to date. All repositories are up to date. The following 2 package(s) will be affected (of 0 checked): New packages to be INSTALLED: nginx: 1.22.1_1,3 Installed packages to be UPGRADED: pcre: 8.45_1 -> 8.45_3 Number of packages to be installed: 1 Number of packages to be upgraded: 1 The process will require 1 MiB more space. 2 MiB to be downloaded. Proceed with this action? [y/N]:
not sure when this was introduced and what is the right behaviour we should have, I will dig into it, thanks.
^Triage: Assign to committer investigating & pending feedback