ldconfig 是 Linux/Unix 系统中的一个命令,用于配置动态链接器(dynamic linker)运行时的共享库缓存:它会扫描指定目录(如 /lib、/usr/lib 等)中的共享库,更新 /etc/ld.so.cache(以及相关符号链接),从而让程序在运行时更快、更正确地找到所需的 .so 库文件。
(在不同发行版中细节略有差异;它也常在安装/升级库之后被自动触发。)
/ˌɛl diː ˈkɒn fɪɡ/
I ran ldconfig after installing a new library.
我在安装了一个新库之后运行了 ldconfig。
After upgrading OpenSSL, the admin executed ldconfig -v to rebuild the shared library cache and confirm the loader could locate the new .so files.
升级 OpenSSL 之后,管理员执行了 ldconfig -v 来重建共享库缓存,并确认加载器能够找到新的 .so 文件。
ldconfig 可拆解为 ld + config:
ldconfig 与库缓存机制。 ldconfig 来更新库缓存。 ldconfig。 ldconfig(8) 手册页是最权威、最常见的引用来源。