freebsd-update: ld-elf.so.1: Shared object "libcap_fileargs.so.1" not found, required by

I think someone cut this thread out of the original where I got similar/same error someone else did, and now I lost all that context.
Had problem with existent ld-elf.so.1 on trying to upgrade to FreeBSD 14 to 14.1 but can't find it. Also how would I reinstall this linker?
Code:
root@server:~ # pkg which `locate ld-elf.so.1`
pkg: No package(s) matching ld-elf.so.1
(error was 'ld-elf.so.1: Shared object "libcap_fileargs.so.1" not found, required by [...]' (by head, wc))
 
Last edited:
try to complete upgrade, but not actually how
That depends if you were trying from source or using freebsd-update.

This thread is about ports/packages not a base system library which libelf is; I'm not sure about the libcap_fileargs.

If you used freebsd-update did you do:

freebsd-update -r 14.1-RELEASE upgrade
/usr/sbin/freebsd-update install
shutdown -r now
/usr/sbin/freebsd-update install

I don't know how to upgrade from source so can't help if that's the way you did it.

I've done a 14.0 install, upgrade, then upgrade to 14.1-RELEASE using the steps above and it worked.

I'll have a look at what 14.1 shows for head/wc.
 
I still need to find that package, regardless if it's base system, unless I just have to reinstall all that. The source I installed from is clearly the binary archive (freebsd-update, as linked and called binary, being that archive at freebsd.org, not source code) which failed on the step #1 you listed there.
 
Which package?

Clearly the binary archive? What does that mean?

So far as I can see libelf and libcap_fileargs are in FreeBSD itself, not any package.

As per the link I sent you have a mangled userland. The second freebsd-update install does the userland upgrade.

Try the upgrade again.

Code:
% which head
/usr/bin/head
% ldd /usr/bin/head
/usr/bin/head:
    libutil.so.9 => /lib/libutil.so.9 (0x37466638b000)
    libcasper.so.1 => /lib/libcasper.so.1 (0x374667e4c000)
    libcap_fileargs.so.1 => /lib/libcap_fileargs.so.1 (0x3746685b3000)
    libc.so.7 => /lib/libc.so.7 (0x37466a385000)
    libnv.so.1 => /lib/libnv.so.1 (0x37466931e000)
    [vdso] (0x3746657c5000)
% which wc
/usr/bin/wc
% ldd /usr/bin/wc
/usr/bin/wc:
    libxo.so.0 => /lib/libxo.so.0 (0x3ec3d4fe9000)
    libcasper.so.1 => /lib/libcasper.so.1 (0x3ec3d67da000)
    libcap_fileargs.so.1 => /lib/libcap_fileargs.so.1 (0x3ec3d7831000)
    libc.so.7 => /lib/libc.so.7 (0x3ec3d882c000)
    libutil.so.9 => /lib/libutil.so.9 (0x3ec3d7168000)
    libnv.so.1 => /lib/libnv.so.1 (0x3ec3d9f65000)
    [vdso] (0x3ec3d4136000)

You can see both binaries head and wc link to /lib/libcap_fileargs.so.1

/lib is base FreeBSD, /usr/local/lib would be for installed packages.

Code:
% ls -l /lib/libcap_fileargs.so.1
-r--r--r--  1 root wheel 15704 Jun  4 11:36 /lib/libcap_fileargs.so.1
% ls -l /lib/libelf*
-r--r--r--  1 root wheel 101896 Jun  4 11:36 /lib/libelf.so.2
% freebsd-version -ruk
14.1-RELEASE
14.1-RELEASE
14.1-RELEASE

Your error message: ld-elf.so.1: Shared object "libcap_fileargs.so.1"

There's no libelf.so.1 version in 14.1, it's now libelf.so2 - again all pointing to a userland that has not been upgraded (or went wrong).
 
Sometimes the suggestion is to extract the files manually, but that might be a bit exciting:

 
Upgrade from which version of FreeBSD, exactly?

Do you have ZFS boot environments?


bectl list -c creation




Did you include the two steps that precede the upgrade?



Here, with pkgbase (not using freebsd-update):

Code:
% pkg which /usr/libexec/ld-elf.so.1
/usr/libexec/ld-elf.so.1 was installed by package FreeBSD-clibs-15.snap20240702224122
% pkg which /lib/libcap_fileargs.so.1
/lib/libcap_fileargs.so.1 was installed by package FreeBSD-runtime-15.snap20240702224122
% uname -mvKU
FreeBSD 15.0-CURRENT main-n271015-3cfcbbfaf83a GENERIC-NODEBUG amd64 1500019 1500019
%

With extracts from the two packages for 14.1-RELEASE-p2 on AMD64:

Code:
% strings /tmp/FreeBSD-clibs-14.1p1 | grep -e '^ld-elf.so.1\.'
ld-elf.so.1.full
ld-elf.so.1.debug
% strings /tmp/FreeBSD-runtime-14.1p2 | grep ^libcap_fileargs.so.1
libcap_fileargs.so.1
libcap_fileargs.so.1.debug
libcap_fileargs.so.1
libcap_fileargs.so.1
%
 
At the first place, why do you try to find the base libraries using pkg(8)?
Unless you installed FreeBSD base OS via pkgbase, pkg cannot find base components.
libcap_fileargs.so.1 should exist under /lib, and
ld-elf.so.1 should exist under /libexec respectively.
 
Back
Top