pkg upgrade # What is "(1 candidates)"? [reproducible]

The number of candidates must mean something in some context to developers of pkg, outside of that it's useless.

from: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255967#c1
> Checking for upgrades (1 candidates): 100%
> Processing candidates (1 candidates): 100%

There is actually no need to print anything more than:

Checking for upgrades: 100%
Processing candidates: 100%

Until (N candidates) means something definitive it is meaningless and should not be output.

Maybe also via --debug...
 
I accidentally found another reason for "candidates" - when the repository contains several versions of the same package. Here is my story:

# pkg upgrade
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating GPIO repository catalogue...
GPIO repository is up to date.
All repositories are up to date.
Checking for upgrades (1 candidates): 100%
Processing candidates (1 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.

# pkg version -vRL=
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating GPIO repository catalogue...
GPIO repository is up to date.
All repositories are up to date.
go-bindata-3.1.2 ? orphaned: devel/go-bindata
go14-1.4.3_6 ? orphaned: lang/go14
py38-Wand-0.6.7_1 ? orphaned: graphics/py-wand
tm1637-cuse-g20211129 > succeeds remote (remote has g20211128)

This is my home repository for my home projects.

# pkg query '%o %v %R' | grep tm1637
misc/tm1637-clock g20211125 GPIO
misc/tm1637-cuse g20211129 GPIO
misc/tm1637-kmod g20211122 GPIO

# ls ./FreeBSD:13:armv7/latest/All/ | grep tm1637-cuse
tm1637-cuse-g20211128.pkg
tm1637-cuse-g20211128.txz
tm1637-cuse-g20211129.pkg
tm1637-cuse-g20211129.txz

After I removed the old package with version g20211128 and re-signed the repository everything was OK:

# pkg upgrade
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating GPIO repository catalogue...
Fetching meta.conf: 100% 163 B 0.2kB/s 00:01
Fetching packagesite.pkg: 100% 3 KiB 3.4kB/s 00:01
Processing entries: 100%
GPIO repository update completed. 7 packages processed.
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.

I want to say that the reason may not necessarily be on the side of the FreeBSD owner, especially when using multiple repositories with the same set of packages.
 

It's a nit, but I don't imagine a fix in the near future.

As far as I know, there's no adverse effect on the ability to upgrade.

 
Code:
root@mowa219-gjp4-8570p-freebsd:~ # pkg -d upgrade -r poudriere -n
DBG(1)[68850]> pkg initialized
Updating poudriere repository catalogue...
DBG(1)[68850]> PkgRepo: verifying update for poudriere
DBG(1)[68850]> Pkgrepo, begin update of '/var/db/pkg/repo-poudriere.sqlite'
DBG(1)[68850]> Request to fetch file:///usr/local/poudriere/data/packages/main-default/meta.conf
DBG(1)[68850]> Fetch: fetcher chosen: file
DBG(1)[68850]> Request to fetch file:///usr/local/poudriere/data/packages/main-default/packagesite.pkg
DBG(1)[68850]> Fetch: fetcher chosen: file
DBG(1)[68850]> Request to fetch file:///usr/local/poudriere/data/packages/main-default/packagesite.txz
DBG(1)[68850]> Fetch: fetcher chosen: file
poudriere repository is up to date.
All repositories are up to date.
Checking for upgrades (1 candidates): 100%
Processing candidates (1 candidates): 100%
DBG(1)[68850]> Binary> loading //usr/local/poudriere/data/packages/main-default/All/drm-devel-kmod-5.7.19.g20220223.pkg
Checking integrity...DBG(1)[68850]> check integrity for 1 items added
 done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be REINSTALLED:
        drm-devel-kmod-5.7.19.g20220223 [poudriere] (options changed)

Number of packages to be reinstalled: 1
root@mowa219-gjp4-8570p-freebsd:~ # pkg lock -l
Currently locked packages:
root@mowa219-gjp4-8570p-freebsd:~ # pkg lock drm-devel-kmod
drm-devel-kmod-5.7.19.g20220223: lock this package? [y/N]: y
Locking drm-devel-kmod-5.7.19.g20220223
root@mowa219-gjp4-8570p-freebsd:~ # pkg -d upgrade -r poudriere -n
DBG(1)[68899]> pkg initialized
Updating poudriere repository catalogue...
DBG(1)[68899]> PkgRepo: verifying update for poudriere
DBG(1)[68899]> Pkgrepo, begin update of '/var/db/pkg/repo-poudriere.sqlite'
DBG(1)[68899]> Request to fetch file:///usr/local/poudriere/data/packages/main-default/meta.conf
DBG(1)[68899]> Fetch: fetcher chosen: file
DBG(1)[68899]> Request to fetch file:///usr/local/poudriere/data/packages/main-default/packagesite.pkg
DBG(1)[68899]> Fetch: fetcher chosen: file
DBG(1)[68899]> Request to fetch file:///usr/local/poudriere/data/packages/main-default/packagesite.txz
DBG(1)[68899]> Fetch: fetcher chosen: file
poudriere repository is up to date.
All repositories are up to date.
Checking for upgrades (1 candidates): 100%
Processing candidates (1 candidates): 100%
DBG(1)[68899]> problem has no requests
Checking integrity...DBG(1)[68899]> check integrity for 0 items added
 done (0 conflicting)
Your packages are up to date.
root@mowa219-gjp4-8570p-freebsd:~ #

(I forgot to lock the package after my most recent update of the OS from source.)
 
Code:
root@A9t:/home/luba # pkg upgrade
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking for upgrades (1 candidates): 100%
Processing candidates (1 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.
root@A9t:/home/luba #

How to calculate what has not been updated there and why?

elimelech007 for your one-candidate case, please run:

pkg -ddd upgrade -n
 
So what I think might happen here is that the pkg(7) bootstrap causes pkg itself to be registered as an implicit dependency, thus 1 candidate. But it's already installed so nothing needs to be done. By doing a re-install using the "proper" pkg(8) tool this implicit dependency was removed and consequently also removed that 1 candidate.

Your explanation and solution to pkg upgrade's quirkiness is still easing troubled minds in 2023. ;)
As someone who is new to FreeBSD, this really cleared things up for me.
 
Back
Top