Totally broken system

you can always run sh -x /usr/sbin/freebsd-update but probably will be to much spam and still hard to figure out
if you have bash installed you can even execute it step by step and check results from another terminal
 
kerya I'm assuming the "update manifest" lives in /var/db/freebsd-update, which you tried to rm -rf but ran into a circular symlink. Did you try manually removing that and then rm -rf the directory? If not, then an alternative to try is "mv /var/db/freebsd-update /var/db/freebsd-update.BAD" and then run freebsd-update fetch. If that works correctly then you can have time to work through removing the bad update directory.
Yes I tried both options, it didn't work.
 
Yes I tried both options, it didn't work.
Wait, so as root or sudo you did something like "rm -f /var/db/freebsd-update/f465c3739385890c221dff1a05e578c6cae0d0430e46996d319db7439f884336-install" and that did not work?
Notice there is no trailing slash after the word install.
 
Wait, so as root or sudo you did something like "rm -f /var/db/freebsd-update/f465c3739385890c221dff1a05e578c6cae0d0430e46996d319db7439f884336-install" and that did not work?
Notice there is no trailing slash after the word install.
I mean I can remove the symlink, but it has no effect, it is created over and over after each 'freebsd-update fetch' run.
 
you can always run sh -x /usr/sbin/freebsd-update but probably will be to much spam and still hard to figure out
if you have bash installed you can even execute it step by step and check results from another terminal
Indeed I can and it produces a lot of output, but I don't understand much.
I have tried to copy freebsd-update from a working system, it didn't help.
 
I mean I can remove the symlink, but it has no effect, it is created over and over after each 'freebsd-update fetch' run.
Did you remove the symlink, then as root rm -rf /var/db/freebsd-update, then run freebsd-update fetch?
 
Quick update:
Code:
# freebsd-update -r 14.0-RELEASE upgrade
Looking up update.freebsd.org mirrors... 3 mirrors found.
Fetching metadata signature for 13.2-RELEASE from update2.freebsd.org... done.

Files on mirror (13.2-RELEASE-p6) are older than the
most recently seen updates (13.2-RELEASE-p7).
Cowardly refusing to proceed any further.
 
Isn't that <long-hash>-install directory/symlink created when you ran freebsd-update install? I'm not 100% sure I don't think the freebsd-update fetch creates it. Difficult to reproduce because the only 13.2-RELEASE I still have doesn't create it.


This may be because upgrading from this platform (amd64)
or release (14.0-RELAESE) is unsupported by freebsd-update.
Yes. For some reason it fails to detect it has 13.2-RELEASE-p6, that's why it's constantly trying to download updates it already has.

A bit of a long shot but what does env output?
 
so post #35 it looks like we just had a 13.2-p7 update, related to pf and libclang and the mirror OP is pointing at hasn't been updated to p7 yet
 
Isn't that <long-hash>-install directory/symlink created when you ran freebsd-update install?
I still have a link with that name (f465c3739385890c221dff1a05e578c6cae0d0430e46996d319db7439f884336-install) in /var/db/freebsd-update. Judging by its date/time it was created at the third run of freebsd-update install, after I rebuilt all the ports.
 
I still have a link with that name (f465c3739385890c221dff1a05e578c6cae0d0430e46996d319db7439f884336-install) in /var/db/freebsd-update. Judging by its date/time it was created at the third run of freebsd-update install, after I rebuilt all the ports.
Does the symlink point to itself?
 
Tieks thanks, that is the expected behavior I think. So the symlink pointing to itself is one mystery, and the why does it come back is another mystery. Both beyond my knowledge base.
 
Unexpected solution found. I took /usr/bin and /usr/sbin from another working system with 13.2-RELEASE-p7. After this, freebsd-update downloaded and installed all updates, and I am able to build ports. I don't know what exactly was missing/broken/corrupted, but probably this topic can be closed. Thanks everyone for your support.
 
I took /usr/bin and /usr/sbin from another working system with 13.2-RELEASE-p7.
You need to copy a few more files, or else the system might assume you have p7 while certain libraries and other files haven't been updated.

This is what an update of p5 to p7 changes:
Code:
The following files will be updated as part of updating to
13.2-RELEASE-p7:
/bin/freebsd-version
/lib/libzpool.so.2
/rescue/[
/rescue/bectl
/rescue/bsdlabel
/rescue/bunzip2
/rescue/bzcat
/rescue/bzip2
/rescue/camcontrol
/rescue/cat
/rescue/ccdconfig
/rescue/chflags
/rescue/chgrp
/rescue/chio
/rescue/chmod
/rescue/chown
/rescue/chroot
/rescue/clri
/rescue/cp
/rescue/csh
/rescue/date
/rescue/dd
/rescue/devfs
/rescue/df
/rescue/dhclient
/rescue/disklabel
/rescue/dmesg
/rescue/dump
/rescue/dumpfs
/rescue/dumpon
/rescue/echo
/rescue/ed
/rescue/ex
/rescue/expr
/rescue/fastboot
/rescue/fasthalt
/rescue/fdisk
/rescue/fsck
/rescue/fsck_4.2bsd
/rescue/fsck_ffs
/rescue/fsck_msdosfs
/rescue/fsck_ufs
/rescue/fsdb
/rescue/fsirand
/rescue/gbde
/rescue/geom
/rescue/getfacl
/rescue/glabel
/rescue/gpart
/rescue/groups
/rescue/gunzip
/rescue/gzcat
/rescue/gzip
/rescue/halt
/rescue/head
/rescue/hostname
/rescue/id
/rescue/ifconfig
/rescue/init
/rescue/ipf
/rescue/iscsictl
/rescue/iscsid
/rescue/kenv
/rescue/kill
/rescue/kldconfig
/rescue/kldload
/rescue/kldstat
/rescue/kldunload
/rescue/ldconfig
/rescue/less
/rescue/link
/rescue/ln
/rescue/ls
/rescue/lzcat
/rescue/lzma
/rescue/md5
/rescue/mdconfig
/rescue/mdmfs
/rescue/mkdir
/rescue/mknod
/rescue/more
/rescue/mount
/rescue/mount_cd9660
/rescue/mount_msdosfs
/rescue/mount_nfs
/rescue/mount_nullfs
/rescue/mount_udf
/rescue/mount_unionfs
/rescue/mt
/rescue/mv
/rescue/nc
/rescue/newfs
/rescue/newfs_msdos
/rescue/nos-tun
/rescue/pgrep
/rescue/ping
/rescue/ping6
/rescue/pkill
/rescue/poweroff
/rescue/ps
/rescue/pwd
/rescue/rcorder
/rescue/rdump
/rescue/realpath
/rescue/reboot
/rescue/red
/rescue/rescue
/rescue/restore
/rescue/rm
/rescue/rmdir
/rescue/route
/rescue/routed
/rescue/rrestore
/rescue/rtquery
/rescue/rtsol
/rescue/savecore
/rescue/sed
/rescue/setfacl
/rescue/sh
/rescue/shutdown
/rescue/sleep
/rescue/spppcontrol
/rescue/stty
/rescue/swapon
/rescue/sync
/rescue/sysctl
/rescue/tail
/rescue/tar
/rescue/tcsh
/rescue/tee
/rescue/test
/rescue/tunefs
/rescue/umount
/rescue/unlink
/rescue/unlzma
/rescue/unxz
/rescue/unzstd
/rescue/vi
/rescue/whoami
/rescue/xz
/rescue/xzcat
/rescue/zcat
/rescue/zdb
/rescue/zfs
/rescue/zpool
/rescue/zstd
/rescue/zstdcat
/rescue/zstdmt
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.asan-i386.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.asan-i386.so
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.asan-x86_64.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.asan-x86_64.so
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.cfi-i386.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.cfi-x86_64.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.cfi_diag-i386.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.cfi_diag-x86_64.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.dd-x86_64.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.msan-x86_64.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.stats-i386.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.stats-x86_64.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.tsan-x86_64.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.ubsan_standalone-i386.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.ubsan_standalone-x86_64.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.xray-x86_64.a
/usr/lib/libzpool.a
/usr/lib32/libzpool.a
/usr/lib32/libzpool.so.2
/usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
/usr/src/sys/conf/newvers.sh
/usr/src/sys/contrib/openzfs/module/zfs/dnode.c
/usr/src/sys/netpfil/pf/pf.c
You can skip the /usr/src/ files if you don't have a source tree installed.
 
You need to copy a few more files, or else the system might assume you have p7 while certain libraries and other files haven't been updated.

This is what an update of p5 to p7 changes:
Code:
The following files will be updated as part of updating to
13.2-RELEASE-p7:
/bin/freebsd-version
/lib/libzpool.so.2
/rescue/[
/rescue/bectl
/rescue/bsdlabel
/rescue/bunzip2
/rescue/bzcat
/rescue/bzip2
/rescue/camcontrol
/rescue/cat
/rescue/ccdconfig
/rescue/chflags
/rescue/chgrp
/rescue/chio
/rescue/chmod
/rescue/chown
/rescue/chroot
/rescue/clri
/rescue/cp
/rescue/csh
/rescue/date
/rescue/dd
/rescue/devfs
/rescue/df
/rescue/dhclient
/rescue/disklabel
/rescue/dmesg
/rescue/dump
/rescue/dumpfs
/rescue/dumpon
/rescue/echo
/rescue/ed
/rescue/ex
/rescue/expr
/rescue/fastboot
/rescue/fasthalt
/rescue/fdisk
/rescue/fsck
/rescue/fsck_4.2bsd
/rescue/fsck_ffs
/rescue/fsck_msdosfs
/rescue/fsck_ufs
/rescue/fsdb
/rescue/fsirand
/rescue/gbde
/rescue/geom
/rescue/getfacl
/rescue/glabel
/rescue/gpart
/rescue/groups
/rescue/gunzip
/rescue/gzcat
/rescue/gzip
/rescue/halt
/rescue/head
/rescue/hostname
/rescue/id
/rescue/ifconfig
/rescue/init
/rescue/ipf
/rescue/iscsictl
/rescue/iscsid
/rescue/kenv
/rescue/kill
/rescue/kldconfig
/rescue/kldload
/rescue/kldstat
/rescue/kldunload
/rescue/ldconfig
/rescue/less
/rescue/link
/rescue/ln
/rescue/ls
/rescue/lzcat
/rescue/lzma
/rescue/md5
/rescue/mdconfig
/rescue/mdmfs
/rescue/mkdir
/rescue/mknod
/rescue/more
/rescue/mount
/rescue/mount_cd9660
/rescue/mount_msdosfs
/rescue/mount_nfs
/rescue/mount_nullfs
/rescue/mount_udf
/rescue/mount_unionfs
/rescue/mt
/rescue/mv
/rescue/nc
/rescue/newfs
/rescue/newfs_msdos
/rescue/nos-tun
/rescue/pgrep
/rescue/ping
/rescue/ping6
/rescue/pkill
/rescue/poweroff
/rescue/ps
/rescue/pwd
/rescue/rcorder
/rescue/rdump
/rescue/realpath
/rescue/reboot
/rescue/red
/rescue/rescue
/rescue/restore
/rescue/rm
/rescue/rmdir
/rescue/route
/rescue/routed
/rescue/rrestore
/rescue/rtquery
/rescue/rtsol
/rescue/savecore
/rescue/sed
/rescue/setfacl
/rescue/sh
/rescue/shutdown
/rescue/sleep
/rescue/spppcontrol
/rescue/stty
/rescue/swapon
/rescue/sync
/rescue/sysctl
/rescue/tail
/rescue/tar
/rescue/tcsh
/rescue/tee
/rescue/test
/rescue/tunefs
/rescue/umount
/rescue/unlink
/rescue/unlzma
/rescue/unxz
/rescue/unzstd
/rescue/vi
/rescue/whoami
/rescue/xz
/rescue/xzcat
/rescue/zcat
/rescue/zdb
/rescue/zfs
/rescue/zpool
/rescue/zstd
/rescue/zstdcat
/rescue/zstdmt
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.asan-i386.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.asan-i386.so
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.asan-x86_64.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.asan-x86_64.so
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.cfi-i386.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.cfi-x86_64.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.cfi_diag-i386.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.cfi_diag-x86_64.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.dd-x86_64.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.msan-x86_64.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.stats-i386.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.stats-x86_64.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.tsan-x86_64.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.ubsan_standalone-i386.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.ubsan_standalone-x86_64.a
/usr/lib/clang/14.0.5/lib/freebsd/libclang_rt.xray-x86_64.a
/usr/lib/libzpool.a
/usr/lib32/libzpool.a
/usr/lib32/libzpool.so.2
/usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
/usr/src/sys/conf/newvers.sh
/usr/src/sys/contrib/openzfs/module/zfs/dnode.c
/usr/src/sys/netpfil/pf/pf.c
You can skip the /usr/src/ files if you don't have a source tree installed.
Yes, you are right, and I understand that, but as I said after my trick with /usr/{bin,sbin} freebsd-update fetched and installed these files. Most likely something was missing/corrupted in these folders.

I searched the forum a bit, and I know there is no short answer, but I would like to ask anyway. As far as I know, 'freebsd-update IDS' shows files with incorrect checksums and most probably do not belong to the system and should be updated. If you have few such files it is a piece of cake, but if you have hundreds it becomes a problem. So is there any easy way to update/replace these files without the need to check each file checksum and copy manually? The only solution I can imagine is to clone the FreeBSD source repo and write a script that consumes the file list from 'freebsd-update IDS' output and replaces them. Any thoughts?
 
but as I said after my trick with /usr/{bin,sbin} freebsd-update fetched and installed these files.
Right, that replaced /usr/sbin/freebsd-update, and as far as I know it's fairly 'stand-alone', it doesn't use any other executables. So it looks like your copy of /usr/sbin/freebsd-update may have gotten corrupted somehow.
 
Hmm, that doesn't make it any clearer where the issue could have originated. Although the OP's issue has been resolved I still would like to figure out what caused it.
 
Hmm, that doesn't make it any clearer where the issue could have originated. Although the OP's issue has been resolved I still would like to figure out what caused it.
Me too. I think these are what we know:
  • circular symlink on the -install file/directory.
  • error message on "should never happen, bad manifest"
  • manually removing the bad symlink, rm -rf /var/db/freebsd-update, freebsd-fetch wound up in the same condition.
  • replacing /usr/bin and /usr/sbin from a working system "fixed" it.
I don't know enough about the internals of the freebsd-update command to know "what all that means".
 
Back
Top