the error message when removing a dependency of a vital package is uninformative
# pkg set -v1 freebsd-set-base
Mark FreeBSD-set-base-16.snap20250916192416 as vital? [y/N]: y
# pkg remove freebsd-sendmail
Cannot solve problem using SAT solver, trying another plan
Cannot solve problem using SAT solver, trying another plan
Checking integrity... done (0 conflicting)
1 packages requested for removal: 0 locked, 1 missing
#
since FreeBSD-set-base depends on FreeBSD-sendmail, pkg refuses to remove sendmail while set-base is installed, which is correct. however, it doesn't explain why.
since we will probably ship FreeBSD 15.0 with set-base marked as a vital package by default, this is going to confuse users; the error message should explicitly say that it's refusing to remove FreeBSD-sendmail and that that's because a vital package requires it.
The other behavior that I noted in https://reviews.freebsd.org/D52562 is something that we may want to consider for pkg groups, if we haven't already. If you assume that freebsd-set-base is not vital in this example and idid something like:
# pkg install freebsd-set-base
# pkg remove freebsd-sendmail
My recollection is that freebsd-set-base as a metapackage will bring in all of its dependencies recorded as automatic, so removing freebsd-sendmail would remove freebsd-set-base and presumably leave those dependencies, subject to the next pkg autoremove. I don't think it would make sense for a metapackage, but for a group I think it'd make sense to (maybe optionally) be able to propagate the non-automatic status to pkgs in the group so that you're effectively subscribed to all of the group members as well. Essentially: a mechanism for the user to use the group as a starting point, and effectively break the grouping but keep everything as if they elected for it all themselves.
I'm currently unable to test, what happens with force? For example,
pkg delete --force freebsd-sendmail
Then (off-topic from error messages),
pkg check -d
I'm currently unable to test, what happens with force? For example,
pkg delete --force freebsd-sendmail
using pkg delete -f will delete the package, then pkg check -a -d will try to reinstall it. however we shouldn't be expecting users to use -f for basic operations like removing a leaf package from base.
@kevans91 yes, I agree, we should have some kind of mecanism like this for groups, we should probably write a full spec somewhere before finishing the group implementation as such feature was part of the initial plan and has been lost in the meantime
however we shouldn't be expecting users to use
-ffor basic operations like removing a leaf package from base.
What is the reason for pushing PKGBASE then?
I thought that one of its selling points was that I could remove (and not install again) parts of FreeBSD system that I do not want and do not use - like Sendmail or Easy Editor for example.
Its not possible to remove these packages w/o --force flag so people use what work - the --force flag - to make FreeBSD system the way they want.
IMHO pkg(8) should find a way to NOT install them again as user does not want them anyway ... some blacklist for example?
Regards, vermaden
Comment moved to:
- https://github.com/freebsd/pkg/issues/2089#issuecomment-3445206409
@dlangille FYI (and thanks).
however we shouldn't be expecting users to use
-ffor basic operations like removing a leaf package from base.What is the reason for pushing PKGBASE then?
i don't understand what you're asking.
I thought that one of its selling points was that I could remove (and not install again) parts of FreeBSD system that I do not want and do not use - like Sendmail or Easy Editor for example.
yes, that is the point of pkgbase.
IMHO
pkg(8)should find a way to NOT install them again as user does not want them anyway ... some blacklist for example?
neither sendmail nor ee are part of the minimal set, so the correct way to remove sendmail is:
- remove the optional set, or do not install it in the first place
- remove sendmail
the problem here is that all the packages which were installed as dependencies of optional are now autoremovable. however that is a separate issue from this bug, which is specifically about the (lack of) error message when attempting to remove the package when the optional set is still installed.
neither sendmail nor ee are part of the
minimalset, so the correct way to remove sendmail is:* remove the optional set, or do not install it in the first place * remove sendmail
Why one needs to be limited to a 'SET'?
For example I just want to remove sendmail(8) but want to keep rest of the set packages ... how am I to do that in a 'supported' way?
For example I just want to remove
sendmail(8)but want to keep rest of the set packages ... how am I to do that in a 'supported' way?
- remove the optional set (this does not remove any other packages)
- remove sendmail
https://github.com/freebsd/pkg/issues/2517#issuecomment-3304269466
… subject to the next
pkg autoremove. …
– will offer to remove FreeBSD-set-optional meta package remnants.
… subject to the next
pkg autoremove. …– will offer to remove FreeBSD-set-minimal meta package remnants.
this shouldn't happen, because 1) bsdinstall always installs set-minimal explicitly, so it should never be autoremoved, and 2) even if it was marked as autoinstalled, it's a vital package, so it still shouldn't be autoremoved.
if you have an example of removing set-base causing set-minimal to be autoremoved, please post the details to [email protected] (not in this bug report) since this is a bug we will want to fix.
Sorry, a typo. Corrected in my previous comment.