Re: HEADS-UP: pkgbase pkg upgrade breaks systems Re: after updating to latest, pkg base segfaults and leaves me unbootable

From: Guido Falsi <mad_at_madpilot.net>
Date: Tue, 19 Aug 2025 08:40:07 UTC
On 8/19/25 03:23, Tilde Joy wrote:
> On 8/14/25 18:17, Guido Falsi wrote:
> 
>> Hi,
>>
>> I was also bitten by this. I'm sharing how I got past the issue in 
>> case it could be useful to others.
>>
>> I recovered by rolling back to a previous ZFS snapshot using an USB 
>> installation media. This can be a viable solution depending on FS 
>> being used and availability of snapshots.
>>
>> Anyway, after taking the machine to a usable state I was able to 
>> update past the tripping point by doing:
>>
>> pkg-static upgrade -r <base-repo> -g 'FreeBSD-runtime*' 'FreeBSD-pkg- 
>> bootstrap*' 'FreeBSD-clibs*'
>>
>> (the bootstrap part is most probably not needed)
>>
>> this will tell you it wants to remove the pkg package, but will not do 
>> so, since there is no '-f' option. After this proceed with a `pkg- 
>> static -r <base-repo> upgrade`.
>>
>> Depending on how old the previous installation is you will need to 
>> check for new packages to install, I was missing a bunch -dev and -man 
>> ones, and some new ones.
>>
>> I then had to add this to libmap.conf (actually to /usr/local/etc/ 
>> libmap.d/upgrade.conf):
>>
>> libcrypto.so.30 libcrypto.so.35
>> libutil.so.9 libutil.so.10
>> libssl.so.30 libssl.so.35
>>
>>
>> So old ports depending on old libraries still work. I'm keeping these 
>> for a while, until I can perform a `pkg upgrade -f`
>>
>>
>> Hope this can be helpful until the issue is solved.
> 
> thanks for this guido, this helped me out a lot,
> 
> in my case the first command still aborted with pkg trying to remove 
> itself,

Yes, my procedure was based on the upgrade of a machine with few ports 
instal;led (I use it almost exclusively as headless builder)

On machines with Xorg, XFCE and a bunch more ports things got more 
complicated, I did need to remove and later reinstall a bunch of ports.

So a general procedure cannot be written down, many factors at play, but 
upgrading clibs and runtime individually and leveraging libmap are the 
main takeaways.


Another option, in such situations, could be booting with an 
installation media, configure access to the repo (copying files to an 
USB key, configuring network manually etc.) and using pkg-static from 
there, pointing to the actual installation. But I did not test this so, 
be careful!

> i had to run the arguments separately:
> 
> pkg-static upgrade -r FreeBSD-base -g 'FreeBSD-runtime*'
> pkg-static upgrade -r FreeBSD-base -g 'FreeBSD-pkg-bootstrap*'
> pkg-static upgrade -r FreeBSD-base -g 'FreeBSD-clibs*'
> 
> and these were the new packages i installed:
> 
> FreeBSD-bsdconfig
> FreeBSD-gssd
> FreeBSD-kerberos-kdc
> FreeBSD-libmilter
> FreeBSD-rip
> FreeBSD-test
> 
> not sure if any of these were essential or not, can't hurt to have them 
> i suppose,
> but i'm finally updated to 15.0-PRERELEASE <3

There are a bunch of new base packages that need to be installed. There 
used to be a recipe to find new and old packages on the wiki but I 
cannot find it anymore, anyway this is what I do (taken from the old 
wiki page):

pkg query -e '%o = base' %n > /tmp/b.out
pkg rquery -r mpnet-base %n > /tmp/a.out
diff /tmp/a.out /tmp/b.out | sed -e '/-dbg/d' | grep "^[<>]"


the sed to remove -dbg packages is there because I usually don't install 
those.

-- 
Guido Falsi <mad@madpilot.net>