Opensuse

所有或非常多的共享庫無法載入 - openSUSE

  • January 22, 2015

由於某種原因,所有(或很多)共享庫都不再載入。但是,ldconfig 聲稱該庫存在。

web6:~ # sendmail -?
sendmail: error while loading shared libraries: libdb-4.8.so: cannot open shared object file: No such file or directory
web6:~ # ldconfig -v | grep libdb-4.8
       libdb-4.8.so -> libdb-4.8.so
web6:~ # sendmail -?
sendmail: error while loading shared libraries: libdb-4.8.so: cannot open shared object file: No such file or directory
web6:~ # zypper -?
zypper: error while loading shared libraries: libmodman.so.1: cannot open shared object file: No such file or directory
web6:~ # rpm -qa | grep libdb-
   libdb-4_8-4.8.30-17.1.4.x86_64
   libdb-4_8-32bit-4.8.30-17.1.4.x86_64
web6:~ #

關於可能發生什麼的任何建議?

這會影響許多程序,儘管 Apache2 仍然可以。當使用者說聯繫表單不再通過電子郵件發送送出時,我發現了這一點。

LD_DEBUG=libs sendmail -?
         1927:     find library=libresolv.so.2 [0]; searching
         1927:      search cache=/etc/ld.so.cache
         1927:       trying file=/lib64/libresolv.so.2
         1927:
         1927:     find library=libnsl.so.1 [0]; searching
         1927:      search cache=/etc/ld.so.cache
         1927:       trying file=/lib64/libnsl.so.1
         1927:
         1927:     find library=libcrypt.so.1 [0]; searching
         1927:      search cache=/etc/ld.so.cache
         1927:       trying file=/lib64/libcrypt.so.1
         1927:
         1927:     find library=libm.so.6 [0]; searching
         1927:      search cache=/etc/ld.so.cache
         1927:       trying file=/lib64/libm.so.6
         1927:
         1927:     find library=libdb-4.8.so [0]; searching
         1927:      search cache=/etc/ld.so.cache
         1927:      search path=/lib64/tls/x86_64:/lib64/tls:/lib64/x86_64:/lib64:/usr/lib64/tls/x86_64:/usr/lib64/tls:/usr/lib64/x86_64:/usr/lib64     (system search path)
         1927:       trying file=/lib64/tls/x86_64/libdb-4.8.so
         1927:       trying file=/lib64/tls/libdb-4.8.so
         1927:       trying file=/lib64/x86_64/libdb-4.8.so
         1927:       trying file=/lib64/libdb-4.8.so
         1927:       trying file=/usr/lib64/tls/x86_64/libdb-4.8.so
         1927:       trying file=/usr/lib64/tls/libdb-4.8.so
         1927:       trying file=/usr/lib64/x86_64/libdb-4.8.so
         1927:       trying file=/usr/lib64/libdb-4.8.so
         1927:
sendmail: error while loading shared libraries: libdb-4.8.so: cannot open shared object file: No such file or directory

這是關鍵:

sendmail: error while loading shared libraries: libdb-4.8.so: cannot open shared object file: No such file or directory

libdb-4.8.so的不見了。這可能是升級失敗或磁碟損壞的結果。您應該重新安裝其包含的包(在您的情況下,我使用scout或一些rpm命令來找出它屬於哪個包,然後重新安裝此包)。

您的其他庫可能是正確的 - 僅當一個庫依賴於另一個庫(這次是在 libdb 上)並且此依賴項已損壞時,它也不會載入。

如果您的系統上確實有很多失去/損壞的庫,那麼它可能無法啟動。

如果它真的不起作用(某些 rpm 或安裝腳本也需要缺少的庫之一),您也可以手動將其複制回來。當然,在這種情況下,您也應該定期重新安裝該軟體包,這樣的更新檔解決方案僅作為臨時有效。

引用自:https://serverfault.com/questions/661397