ld-elf.so.1: /usr/sbin/pkg: Undefined symbol "fetchDebug"

I'm not sure what happened, but suddenly any attempt to run pkg says ld-elf.so.1: /usr/sbin/pkg: Undefined symbol "fetchDebug". I tried reinstalling it from ports, and I got this error ld-elf.so.1: /usr/bin/fetch: Undefined symbol "fetchRestartCalls", but I managed to download the file it wanted with wget and that way I could compile and reinstall pkg. Pkg installed fine, but it's still giving the same error. I'm not sure if it matters that the ports tree I used was the "freebsd-ports" one from github, and i just did a git pull before building pkg. I tried running freebsd-update fetch install to see if it could fix this but I got this output:
Code:
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching metadata signature for 14.0-RELEASE from update1.freebsd.org... failed.
Fetching metadata signature for 14.0-RELEASE from update2.freebsd.org... failed.
Fetching metadata signature for 14.0-RELEASE from dualstack.aws.update.freebsd.org... failed.
No mirrors remaining, giving up.

This may be because upgrading from this platform (amd64)
or release (14.0-RELEASE) is unsupported by freebsd-update. Only
platforms with Tier 1 support can be upgraded by freebsd-update.
See https://www.freebsd.org/platforms/ for more info.

If unsupported, FreeBSD must be upgraded by source.
If I go to any of these domains in chromium I get a "403 Forbidden".
I'm not sure what else to try at this point, and I don't really want to reboot for fear of even more stuff breaking and my system getting completely hosed.
Although it seems only fetch and pkg are broken right now.
 
I'm not sure if it matters that the ports tree I used was the "freebsd-ports" one from github
Nope, it's just a convenient copy of the same ports tree from git.freebsd.org, it'll be exactly the same.

I tried running freebsd-update fetch install to see if it could fix this but I got this output:
That output looks off. Not what it's supposed to show. What does freebsd-version -urk output?

Although it seems only fetch and pkg are broken right now.
Try pkg bootstrap -f and see if that at least fixes pkg(8).
 
Nope, it's just a convenient copy of the same ports tree from git.freebsd.org, it'll be exactly the same.


That output looks off. Not what it's supposed to show. What does freebsd-version -urk output?


Try pkg bootstrap -f and see if that at least fixes pkg(8).
freebsd-version -urk says:
Code:
14.0-RELEASE-p5
14.0-RELEASE-p5
14.0-RELEASE-p5
And pkg bootstrap -f says the same "Undefined symbol" error.
It seems I cannot run pkg at all, which makes sense, I think it can't even actually start the program.
 
doas pkg-static bootstrap -f says:
Code:
pkg(8) is already installed. Forcing reinstallation through pkg(7).
ld-elf.so.1: /usr/sbin/pkg: Undefined symbol "fetchDebug"
doas pkg-static install -f pkg reinstalls pkg just fine but doesn't actually fix the error.
 
I seem to have fixed it by copying /usr/lib/libfetch.so.6 from a jail with working pkg to my host system. I have compared the broken and working libfetch, and the broken is substantially smaller, and also has some strange strings in it?
wtf_weird_diff.png
 
This is what running strings on the broken libfetch says:
Code:
FreeBSD
_init
_fini
__cxa_finalize
_Jv_RegisterClasses
truncate_str
remove_brackets
strlen
get_twidth
ioctl
get_sys
__xuname
get_cpu
fgets
sscanf
rewind
sprintf
get_ram
popen
fclose
get_gpu
setenv
strcmp
strstr
get_res
get_pkg
strcat
access
fscanf
pclose
get_model
get_ker
get_upt
sysctl
time
get_info
fopen
opendir
closedir
gethostname
getenv
strcpy
snprintf
pthread_create
pthread_join
libthr.so.3
FBSD_1.0
libc.so.7
/usr/bin/pacman
debian
pacman -Qq 2> /dev/null | wc -l
ID=%s
/usr/bin/apt
(apt)
ID="%s"
SHELL
getprop ro.hardware.vulkan 2> /dev/null
  Height: %d
/usr/bin/rpm
(rpm)
raspbian
USER
Buffers:          %d
(port)
rpm -qa --last 2> /dev/null | wc -l
sysctl hw.model
LANG=EN_us freecolor -om 2> /dev/null
xwininfo -root 2> /dev/null | grep -E 'Width|Height'
/usr/bin/pkg_info
/usr/bin/port
/usr/bin/pkg
find $(brew --cellar 2>/dev/stdout) -maxdepth 1 -type d 2> /dev/null | wc -l | awk '{print $1}'
(guix)
/usr/bin/brew
xbps-query -l 2> /dev/null | wc -l
processor%*[    |    ]: %[^
/usr/bin/nix-store
(pacman)
whoami
Cached:          %d
apk info 2> /dev/null | wc -l
(apk)
snap list 2> /dev/null | wc -l
Name
(nix)
(pkg)
(xbps)
amogos
%s Cores
lspci -mm 2> /dev/null | grep "VGA" | awk -F '"' '{print $4 $5 $6}'
/usr/bin/guix
hw.hv_vendor: %[^
/usr/share/plymouth/themes/amogos
/usr/bin/apk
guix package --list-installed 2> /dev/null | wc -l
pkg_info 2>/dev/null | wc -l | sed "s/ //g"
%s %s %s
(brew-cellar)
(brew-cask)
MemTotal:       %d
(emerge)
/usr/bin/flatpak
nix-store -q --requisites /run/current-system/sw 2> /dev/null | wc -l
/Library/
    product: %[^
/usr/bin/qlist
SReclaimable:     %d
LANG
qlist -I 2> /dev/null | wc -l
sysctl hw.hv_vendor
pkg info 2>/dev/null | wc -l
/etc/os-release
/system/app/
Shmem:             %d
  Width: %d
/usr/bin/xbps-query
lshw -class display 2> /dev/null
(flatpak)
flatpak list 2> /dev/null | wc -l
/usr/bin/snap
find $(brew --caskroom 2>/dev/stdout) -maxdepth 1 -type d 2> /dev/null | wc -l | awk '{print $1}'
en_US
apt list --installed 2> /dev/null | wc -l
port installed 2> /dev/null | tail -n +2 | wc -l
/system/priv-app/
(snap)
hw.model: %[^
MemFree:        %d
android
ffff.
AWAVATSH
~[E1
}BMc
[A\A^A_]
AWAVAUATSP
[A\A]A^A_]
AWAVAUATSH
([A\A]A^A_]
AWAVAUATSH
ffff.
$ffffff.
'ff.
[A\A]A^A_]
AWAVAUATSP
[A\A]A^A_]
AWAVAUATSH
([A\A]A^A_]
fffff.
AWAVATS
[A\A^A_]
AVSH
 [A^]
AWAVAUATSH
"u    A
amog
android
unknown
[A\A]A^A_]
 
I think I solved it, shortly before pkg broke, i installed a program called "uwufetch" from source, and it builds something called "libfetch" too. The strings on that library match the ones on the broken libfetch. So It seems that it overwrote my FreeBSD libfetch when I make install'ed it. Pretty funny that my system broke because of a program called "uwufetch" lol
 
At least in quarterly there is no port/package name uwufetch; I'm guessing the default install path in that source is /usr not /usr/local. /usr would be correct for Linux distros, for FreeBSD /usr (/usr/lib, /usr/bin, etc) is pretty much reserved for base, while ports typically install in /usr/local (/usr/local/lib, /usr/local/bin, etc).

An argument could be made that it was user error building from source by not configuring the install path correctly; that's why a lot of people simply use prebuilt packages or build from a ports tree (which typically installs in /usr/local).
So be careful when building non-native software from source, pay attention to the install path.
 
At least in quarterly there is no port/package name uwufetch; I'm guessing the default install path in that source is /usr not /usr/local. /usr would be correct for Linux distros, for FreeBSD /usr (/usr/lib, /usr/bin, etc) is pretty much reserved for base, while ports typically install in /usr/local (/usr/local/lib, /usr/local/bin, etc).

An argument could be made that it was user error building from source by not configuring the install path correctly; that's why a lot of people simply use prebuilt packages or build from a ports tree (which typically installs in /usr/local).
So be careful when building non-native software from source, pay attention to the install path.
Yeah, I installed from source, and it installed to the /usr prefix, I opened an issue on their github.
 
Back
Top