Environment
pkg version 2.7.5 on FreeBSD 15.0-RELEASE-p8
Background
When pkg install runs and it sees that pkg itself is outdated, it offers to update pkg before proceeding.
Problem
When pkg updates itself as part of a pkg install -A command (including non-interactive pkg install -A -y) to temporarily install a package subject for later auto-removal, the updated pkg itself is also marked as automatically installed and becomes subject to auto-removal. Then later when pkg autoremove is run, pkg gets removed as well, unless marked as vital.
Workaround
Run pkg set -v 1 -y pkg to mark pkg as vital—this prevents it from being auto-removed.
Environment
pkg version 2.7.5 on FreeBSD 15.0-RELEASE-p8
Background
When
pkg installruns and it sees thatpkgitself is outdated, it offers to updatepkgbefore proceeding.Problem
When
pkgupdates itself as part of apkg install -Acommand (including non-interactivepkg install -A -y) to temporarily install a package subject for later auto-removal, the updatedpkgitself is also marked as automatically installed and becomes subject to auto-removal. Then later whenpkg autoremoveis run,pkggets removed as well, unless marked as vital.Workaround
Run
pkg set -v 1 -y pkgto markpkgas vital—this prevents it from being auto-removed.