在公司里,SA习惯把很多包直接拷贝到其他的机器上,因为缺少包管理工具做依赖性的检查。经常遇到开发找我解决一些缺失动态连接库引起的问题。其实解决起来也很简单ldd查看一下到底少什么库,再google一下对应的库是属于什么包的,然后装上就OK了。已今天遇到的mod_ssl.so不能加载的问题为例。# ldd mod_ssl.solinux-gate.so.1 => (0xffffe000)libssl.so.4 => not foundlibcrypto.so.4 => not foundlibgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0xf7f31000)libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0xf7e9b000)libcom_err.so.2 => /lib/libcom_err.so.2 (0xf7e97000)libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0xf7e71000)libresolv.so.2 => /lib/libresolv.so.2 (0xf7e5e000)libdl.so.2 => /lib/libdl.so.2 (0xf7e5a000)libz.so.1 => /usr/lib/libz.so.1 (0xf7e47000)libpthread.so.0 => /lib/libpthread.so.0 (0xf7e2f000)libc.so.6 => /lib/libc.so.6 (0xf7ce8000)libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0xf7cdf000)libkeyutils.so.1 => /lib/libkeyutils.so.1 (0xf7cdc000)/lib/ld-linux.so.2 (0x00a3e000)libselinux.so.1 => /lib/libselinux.so.1 (0xf7cc4000)libsepol.so.1 => /lib/libsepol.so.1 (0xf7c7e000)

yum install openssl097a.x86_64 openssl097a.i386
LDD(1)                                                                  LDD(1)
NAMEldd – print shared library dependencies
SYNOPSISldd [OPTION]…  FILE…
DESCRIPTIONldd  prints  the  shared  libraries  required by each program or sharedlibrary specified on the command line.

OPTIONS–versionPrint the version number of ldd.

-v –verbosePrint all information, including e.g. symbol versioning informa-tion.

-u –unusedPrint unused direct dependencies.

-d –data-relocsPerform relocations and report any missing objects (ELF only).

–help Usage information.