pkg icon indicating copy to clipboard operation
pkg copied to clipboard

pkg upgrade -f does not reinstall older versions in repo than currently installed

Open fichtner opened this issue 5 years ago • 3 comments

For the sake of using pkg upgrade -f after upgrades it would be a lot saner to reinstall to older versions of currently installed packages too. OS version and ABI did not change.

Seen on pkg 1.12.0, not sure if it existed before but it was surprising to see.

fichtner avatar Jan 27 '20 11:01 fichtner

I keep that for the futur, it sounds weird to have older version in the repo. I need to think more about it

bapt avatar Jan 27 '20 11:01 bapt

It's certainly fringe case, but it could happen switching from latest to quarterly. The impact is debatable as well, but in general it would be nicer to have a consistent package layout against the online repo that was upgraded against.

The manual, however, is less definitive on the subject: "If the -f (force) flag is given, all installed packages are added to the work list". At least from this I always expected older packages to be reinstalled as well as they count as "installed". :)

Thanks for the quick feedback.

fichtner avatar Jan 27 '20 11:01 fichtner

Hi @bapt,

Any conclusive decision on this? It's still an issue for us when the package repository changes that -f does not adapt all the packages in all edge cases as it would hopefully imply.

The matter is just that if pkg tries to outsmart the upstream repo's consistency it is a recipe for latent issues and frustration.

In OPNsense, we run into this issue on ABI upgrades where our top package is not forced to reinstall leaving the ABI change half-done. Since the top package also switches to the new package mirror that is an issue not easily solved by automation. In these cases we have to carefully craft package version and development tags to not try to force a backwards shift of the top package even though that would be completely fine from an upgrade perspective and the most consequent thing to do.

If you have any questions please let me know. :)

Cheers, Franco

fichtner avatar Jul 19 '20 18:07 fichtner