Upgrade of specific package

It can be done, but you might find it's going to upgrade more than you bargained for. Dependencies might need to be upgraded too, which then causes a cascade of other ports/packages to be upgraded.

I don't upgrade single packages, it's all or nothing. But I'm building my own custom package repositories, so I'm not impacted by any "missing" dependencies, I'm well aware of the things that failed to build and the consequences those failures might bring.
 
We must always consider the option of doing a full upgrade when possible, firstly because, as stated above:
I don't upgrade single packages, it's all or nothing. But I'm building my own custom package repositories, so I'm not impacted by any "missing" dependencies(...)
It can break the system and secondly, keeping the entire system up to date helps to correct possible vulnerabilities (CVEs).
# pkg audit -f
 
it's all or nothing.
I must admit. Sometimes my package system is in need of an Quarterly pkg update and I am putting it off.
But then I want new wizbang XXPS7 program.
Then I do an individual pkg install/upgrade dependencies.. Just to get some wizbang until I do full Quarterly upgrade. I single step through the upgrade. It can be a minefield.
Something like Firefox is not feasible. Something with few dependencies OK.
 
Is it safe to upgrade a specific package, e.g. pkg upgrade firefox? What has been your experience?
Context matters. On my FBSD machine (rel+quarterly) I use portmaster for building everything except monsters, so pkg upgrade -f firefox is usual command. And it works.
 
I do see this in my history and u-boot requires a "tool chain" but upgrades fine.

pkg upgrade -f u-boot-rock-pi-4

Firefox has many minor version upgrades so it really depends on what it is trying to change.

A perfect use for pkg dryrun.
pkg upgrade --dry-run firefox | more
 
Note that pkg upgrade -f {...} not only upgrades a package when an upgrade is available, it will also force a reinstall if the version is the same. So, maybe not use -f all the time?

Code:
     -f, --force
                 Force the reinstallation or upgrade of the whole set of
                 packages.
pkg-upgrade(8)
 
Not 100% sure, but legacy upgrading tools like portupgrade creates package of currently installed version, deinstall current version and install updated version AFTER successful builds. If install phase failed, portupgrade cleans up the updated version and reinstall deleted previous version from backup.

At the beginning, if I recall correctly, creating backup packages was done using stored pkg-plist in its database. Maybe currently using pkg create instead? So would be deinstall and install.

And if I recall correctly, forcibly upgrading single ports didn't force upgrading of dependencies, unless any of the *_DEPENDS forces new version.

If my understanding is correct, pkg create to backup currently installed version, pkg delete -f to forcibly deinstall currently installed version and pkg install to install new version would what is wanted?
 
It can be done, but you might find it's going to upgrade more than you bargained for. Dependencies might need to be upgraded too, which then causes a cascade of other ports/packages to be upgraded.
It's fine that dependencies will be upgraded as well. That is what I am interested in — that all dependencies are correctly updated during pkg upgrade package_name. For clarity, I don't mean pkg upgrade -f package_name.
 
Back
Top