Solved freebsd-update broken

cm-vdp

Member

Reaction score: 1
Messages: 34

Hi,

I was upgrading my system from freebsd 12.0-RELEASE-p10 to 12.1 but I made a big mistake.
Instead of "freebsd-update upgrade -r 12.1-RELEASE" I did "freebsd-update upgrade -r 12.0-RELEASE"
I also executed "freebsd-update install". From that moment the system was messed up.
Commands (gzip, tar, pkg, ....) didn't run anymore. Lots off errors : ld-elf.so.1: Shared object "libxxxx.so.x" not found. Shared objects did have a size of 0 bytes. Other errors as "bus error"
"pkg-static upgrade -f" did not fixed the problem.
So I copy /lib, /bin, /sbin, /usr/bin, /usr/sbin, /usr/lib and /usr/lib32 from another server (also freebsd12.0p10). This fixed the problem.
To be sure I rebooted the server. Running freebsd-version : 12.0-RELEASE-p13

I though everything was ok and I could do the upgrade to 12.1.
"freebsd-update upgrade -r 12.1-RELEASE "give new errors.
This is what I do:

Code:
# rm -rf /var/db/freebsd-update/*

# freebsd-update fetch  (I also tried with the -F option)
Fetching public key from update1.freebsd.org... done.
Fetching metadata signature for 12.0-RELEASE from update1.freebsd.org... done.
Fetching metadata index... done.
Fetching 2 metadata files... done.
Inspecting system... done.
Preparing to download files... done.

No updates needed to update system to 12.0-RELEASE-p13.
Code:
# freebsd-update install
No updates are available to install.
Run '/usr/sbin/freebsd-update fetch' first.
Code:
# freebsd-update upgrade -r 12.1-RELEASE

Fetching metadata signature for 12.0-RELEASE from update2.freebsd.org... done.
Fetching metadata index... done.
Fetching 1 metadata files... done.
Inspecting system... done.

The following components of FreeBSD seem to be installed:
kernel/generic world/base world/doc world/lib32

The following components of FreeBSD do not seem to be installed:
kernel/generic-dbg world/base-dbg world/lib32-dbg

Does this look reasonable (y/n)? y

Applying patches... done.
Fetching 74 files... done.
/usr/sbin/freebsd-update: cannot open files/.gz: No such file or directory
/usr/sbin/freebsd-update: cannot open files/.gz: No such file or directory
/usr/sbin/freebsd-update: cannot open files/.gz: No such file or directory
....
I also received notifications for deleting files in /etc (auto_master, shells, all files in rc.d ...)
All the files containing the following line:
Code:
# $FreeBSD: releng/12.1/usr.sbin/autofs/auto_master 337749 2018-08-14 13:52:08Z trasz $
I have no clue why the files have 12.1 as version.

With other words the update/upgrade is broken.
Is there way to fix the upgrade or do I need to reinstall the OS ?

Thanks in advance
 

Phishfry

Son of Beastie

Reaction score: 1,975
Messages: 4,967

I would have recommended that you run freebsd-update rollback.
But with you deleting /var/db/freebsd-update/* you burned that bridge.
The only thing you could try is to force an upgrade to 12.1
freebsd-update upgrade -F -r 12.1-RELEASE

You could check the integrity of your installation with freebsd-update IDS
 
OP
C

cm-vdp

Member

Reaction score: 1
Messages: 34

output of freebsd-update IDS at this moment a lot of hash errors

Code:
/boot/beastie.4th has SHA256 hash 10cdc6a1cb79041320ed831bcdeb2bb6a6cdf76f4b725b2bcfab13942d500b9a, but should have SHA256 hash 67b780583c7cfb9fa8792ee1afa1d25a03fdaaef827ca7b55c1970034e633eda.
/boot/boot has SHA256 hash 456fce3095507cc71761e922ff395648adde205da55a1d52476634e5b3dcf2b5, but should have SHA256 hash 3881d45fde80a9ec237db125693c56e90d9ca7c4a2a38ecf83e24b138343813f.
/boot/boot1.efi has SHA256 hash 49c40a780a8fc7e90f46b7792ca76837916d4eb9aacf10d8c4d27b3953e5c9f2, but should have SHA256 hash 2af7d1b557019c36d1c17f55a28a214d6deb8bb86dee1cd2ad0c379349016a2e.
/boot/boot1.efifat has SHA256 hash e66fcf06a987f27ae35a8362e82aeb38aaec46ab79796428aa9caab87646993c, but should have SHA256 hash fd926f90a36913d62150ae4f38803e74c637abf5e7c03fac270ca3a227542cd4.
.....
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 9,283
Messages: 33,826

I would try freebsd-update --currently-running 12.0-RELEASE -r 12.1-RELEASE upgrade.
 
OP
C

cm-vdp

Member

Reaction score: 1
Messages: 34

I would try freebsd-update --currently-running 12.0-RELEASE -r 12.1-RELEASE upgrade.
I already tried freebsd-update -r 12.1-RELEASE --currently-running 12.0-RELEASE-p13 upgrade
The same errors continue to appear. Is there a difference between --currently-running 12.0-RELEASE and --currently-running 12.0-RELEASE-p13
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 9,283
Messages: 33,826

Is there a difference between --currently-running 12.0-RELEASE and --currently-running 12.0-RELEASE-p13
I don't think the difference is going to matter much. I fear you pretty much hosed the system though. You could try simply extracting the various tar(1) files from the installation media (I would try 12.0-RELEASE first). Try to restore the system to any decently running version, then run the upgrade again. Hopefully that will restore the system to a reasonable functional state.
 
OP
C

cm-vdp

Member

Reaction score: 1
Messages: 34

OK, I will restore the system OS. Thank for your support.
 

xavi

Active Member

Reaction score: 99
Messages: 140

I was upgrading my system from freebsd 12.0-RELEASE-p10 to 12.1 but I made a big mistake.
Instead of "freebsd-update upgrade -r 12.1-RELEASE" I did "freebsd-update upgrade -r 12.0-RELEASE"
Genuine question to those more knowledgeable than me... Is this something that in theory could be coded for and caught by the freebsd-update process? In other words, could the freebsd-update process check which version it is currently running and then prevent someone from trying to upgrade to the same version? Would seem like an easy catch if it's possible.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 9,283
Messages: 33,826

It already does:
Code:
 # freebsd-version -uk
12.1-RELEASE-p2
12.1-RELEASE-p2
# freebsd-update -r 12.1-RELEASE upgrade
freebsd-update: Cannot upgrade from 12.1-RELEASE to itself
 
OP
C

cm-vdp

Member

Reaction score: 1
Messages: 34

It already does:
Code:
# freebsd-version -uk
12.1-RELEASE-p2
12.1-RELEASE-p2
# freebsd-update -r 12.1-RELEASE upgrade
freebsd-update: Cannot upgrade from 12.1-RELEASE to itself
Why didn't I receive the message "freebsd-update: Cannot upgrade from 12.0-RELEASE to itself"
 
OP
C

cm-vdp

Member

Reaction score: 1
Messages: 34

How I fixed the broken system:

I did a rsync form another 12.0 server for the following directories:

/var/db/etcupdate
/usr/test
/boot
/usr/libexec
/usr/share

After a reboot I could upgrade to 12.1-RELEASE
 
Top