[Bug 291791] bad recommendation by pkg on error

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 19 Dec 2025 00:55:45 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291791

--- Comment #2 from wbe@psr.com ---
(In reply to ivy from comment #1)
>> pkg bootstrap requires /usr/sbin/pkg which does not exist once /usr/local/sbin/pkg has been installed.

> this is not true.  /usr/sbin/pkg is part of the base system and always exists, unless you remove the FreeBSD-pkg-bootstrap package or build WITHOUT_PKGBOOTSTRAP.
Interesting.  This system has been running GENERIC releases, and I've never
deleted /usr/sbin/pkg by hand nor removed the FreeBSD-pkg-bootstrap package. 
/usr/sbin/pkg been absent on this system since at least as far back as
12.0-RELEASE-p1 (2019) [I don't have information from before then], indicating
the file hasn't changed in all that time, else upgrading to a later release
would have re-created it (wouldn't it?).

>> Similarly, pkg's error messages suggest a config error even for non-configuration problems, such as DNS or network outages

> no it doesn't:
> # pkg update
In those 61 lines of error messages, I see "URL error", "No SRV record found",
and "failed to fetch", but they're mixed with saying SRV mirror type expected,
etc., which, to me, sounds more like the config file specifying the wrong
server or URL than a network or DNS issue, especially when the recommendation
is to run pkg bootstrap -f to fix it.  What part of those error messages says
to you check if DNS is working?

>> pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended

> this warning occurs because you have a FreeBSD 14 pkg(8) installed on FreeBSD 15.  as soon as you rebuild/upgrade your ports packages, this warning will go away.
Indeed, but that's the catch: I couldn't pkg upgrade pkg until I figured out it
was a DNS problem, not a pkg configuration problem, and running pkg bootstrap
-f wouldn't have helped, even if I could have done it.

-- 
You are receiving this mail because:
You are the assignee for the bug.