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: Thu, 14 Aug 2025 08:17:17 UTC
On 8/9/25 09:55, Florian Smeets wrote:
> Adding current@ to CC
> 
> On 09.08.25 01:38, Dan Mahoney wrote:
>> 
>> 
>> (Resending from phone after realizing my list-specific from: wasn’t 
>> set, apologies for weird formatting)
>>
>> Hey all,
>>
>> After the recent big sleep in pkgbase, I hit the following trying to 
>> upgrade to whatever snapshot was published today:
>>
>> [598/1127] Deleting files for p5-MIME-Base32-1.303: 100%
>> [599/1127] Deinstalling p5-MIME-Base64-3.16...
>> [599/1127] Deleting files for p5-MIME-Base64-3.16: 100%
>> Child process pid=21537 terminated abnormally: Segmentation fault
>>
>> (oh crap)
>>
>> root@poudriere:/home/dmahoney # pkg upgrade
>> ELF interpreter /libexec/ld-elf.so.1 not found, error 2
>> Abort
>>
>> (double crap)
> 
> Yes, I had the same issue yesterday evening. When the system was back, I 
> was too tired to summarize and send something to the mailing list.
> 
> FWIW, I revived the system by deleting all newer packages rm /var/cache/ 
> pkg/*snap20250808* and just untaring the stuff in /var/cache/pkg to /
> 
> cd / ; for i in `/rescue/ls -1 /var/cache/pkg/FreeBSD-* ` ; do /rescue/ 
> tar xvzf $i ; done
> 
> After that, I resorted to building from source and installing to get the 
> system into a half way consistent state with a chance of surviving a 
> reboot.
> 
> When starting my upgrade I saw that it wanted to remove a lot of non 
> pkgbase packages (how are we doing to differentiate pkgbase packages and 
> "ports" packages in the future?). I thought this might be related to the 
> krb5 thing, so I created an up to date poudriere jail via pkgbase method 
> and rebuilt all my pkgs, but even then I saw the same thing as Den, that 
> pkg wanted to remove a lot of ports pkgs, as this system is not 
> important I thought I can resolve that after the pkgbase upgrade and 
> started the upgrade.
> 
> I didn't save scroll back. In my case I saw at the top the first ~100 
> pkg transactions were uninstalling pkgbase pkgs, then it upgraded some, 
> then pkg exited with a segfault.
> 
> Leaving me with ELF interpreter /libexec/ld-elf.so.1 not found, error 2
> 
> One thing I checked was /libexec/ was completely empty.
> 

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.



-- 
Guido Falsi <mad@madpilot.net>