即使至少缺少一个库,ldd 也不会报告任何依赖项

即使至少缺少一个库,ldd 也不会报告任何依赖项

我的系统上的 ldd 是脚本

$ ldd --version
ldd (GNU libc) 2.35
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

$ file /usr/bin/ldd
/usr/bin/ldd: Bourne-Again shell script, ASCII text executable

$ head -n 29 /usr/bin/ldd|tail
# This is the `ldd' command, which lists what shared libraries are
# used by given dynamically-linked executables.  It works by invoking the
# run-time dynamic linker as a command and setting the environment
# variable LD_TRACE_LOADED_OBJECTS to a non-empty value.

# We should be able to find the translation right at the beginning.
TEXTDOMAIN=libc
TEXTDOMAINDIR=/usr/share/locale

RTLDLIST="/lib/ld-linux.so.2 /lib64/ld-linux-x86-64.so.2 /libx32/ld-linux-x32.so.2"

有时,它无法报告任何内容,尤其是当我试图找出某个程序缺少哪些依赖项时,这尤其令人恼火。

就像今天使用evince一样

$ ldd /usr/bin/evince

$ evince
evince: error while loading shared libraries: libhandy-1.so.0: cannot open
shared object file: No such file or directory

知道为什么 ldd 没有报告任何内容吗?从过去处理这个问题的经验中我知道当我解决第一个缺失的依赖项时(本例中:安装 libhandy-1.so.0)然后 ldd 将显示依赖项列表,包括列出可能其他几个缺失的库。 但我希望 ldd 从一开始就能够正常工作。 遗憾的是,我不知道如何解决这个问题,因为 ldd 看起来是一个太复杂的脚本,我无法轻易理解,而且它什么都没有报告,我甚至不知道它哪里出了问题。

相关内容