Re: FreeBSD 12.2 can not be upgraded

From: Dan Mahoney <freebsd_at_gushi.org>
Date: Sun, 04 Sep 2022 17:24:06 UTC

> On Sep 4, 2022, at 10:05, Doug Denault <doug@safeport.com> wrote:
> 
> There was a long thread on this. My observations and questions are more about how to update production systems. My long standing update path is to update my FreeBSD workstations. If that goes okay we some servers on out LAN that we update next.
> 
> I ran `freebsd-update -r 12.3-RELEASE upgrade` which converted my laptop essentially into a paperweight by the introduction a bad copy of ld-elf.so.1. The system would boot, but most useful commands (think cp) exited with an error. This is all documented via google with no successful work arounds that I could fine. What you can not do is `freebsd-update rollback`. I though I could maybe fix this by going to single user and overwriting ld-elf.so.1. This can not be done as all commands depend on this file.
> 
> I created image files from:
> 
>  FreeBSD-12.3-RELEASE-amd64-dvd1.iso (4+GB)
>  FreeBSD-12.3-RELEASE-amd64-memstick.img ~1GB
> 
> Neither of these images are self contained. Both install 12.3 correctly but by downloading the OS from a mirror site of your choosing. Is there a path thought the dvd1 install that does something with the extra 3GB of data? Does the dvd1.iso image have to be burned to a DVD?

dvd1 includes a bunch of extra local packages, it's otherwise identical to cd1.

You should have a bunch of static binaries in /rescue which include cp.

I've been bitten by this several times in the past (on machines in faraway countries, where my only access was a serial console), where all of a sudden midway through a freebsd update install I'll just see a bunch of segfaults, and I'm still not sure what's happening to cause it, but my solution has been to *before I update* grab a spare tar file for base.txz for my target OS, just in case.

> My am not sure what is the philosophy of deleting the supporting files so quickly. Other than making a system from backup is there a way to install an older version?

Yes.  Grab the base.txz files from ftp.freebsd.org <http://ftp.freebsd.org/> or ftp-archive.freebsd.org <http://ftp-archive.freebsd.org/>, or from your boot cdrom.  Untar them over /, and you should have a working linker back.  I would not call that "a production system" but it should be stable enough to let your system attempt to redo the upgrade.

Yes, freebsd-update is bad at recovering from this failure mode.  The rollback function really is only good for rolling back patchlevels, not major upgrades.  Nor does it have a "wait, you're a shell script, please just use the static files in /rescue, and re-attempt the install" function.

FreeBSD really should have "ftp" or "fetch" or "scp" or  something in /rescue, but there is at least nc, which you can use to get a file on to the box, albeit slowly.

-Dan