Identifying broken applications following careless use of make -DBATCH_DELETE_OLD_FILES delete-old-libs

Jens Schweikhardt schweikh at schweikhardt.net
Mon Dec 14 13:15:09 UTC 2020


Alexander,

it would seem that

find /usr/local/*bin* /usr/local/lib* -type f \
| xargs ldd -f '%p|%A\n' 2>/dev/null \
| grep '^not found' | cut -d '|' -f2 \
| xargs pkg which -q | sort -u

is prone to false positives, since ldd is sensitive to LD_LIBRARY_PATH, viz.:

$ find /usr/local/*bin* /usr/local/lib* -type f \
| xargs ldd -f '%p|%A\n' 2>/dev/null \
| grep '^not found' | cut -d '|' -f2 \
| xargs pkg which -q | sort -u
firefox-84.0_2,2

$ export LD_LIBRARY_PATH=/usr/local/lib/firefox
$ find /usr/local/*bin* /usr/local/lib* -type f \
| xargs ldd -f '%p|%A\n' 2>/dev/null \
| grep '^not found' | cut -d '|' -f2 \
| xargs pkg which -q | sort -u
$

So make sure you look into what exact library is missing and if
it's actually somewhere "non-standard",
that directory should be in LD_LIBRARY_PATH.

Jens


More information about the freebsd-current mailing list