2021-05-12 14:32:11
libreadline.so.6: cannot open shared object file 問題解決辦法
問題描述:在CentOS 6.4 上執行reboot命令之後,系統啟動失敗,不能連線。去伺服器機房,插上顯示器與鍵盤,螢幕給出報錯資訊如下:
“setting up logical volume management: /sbin/lvm : error while loading shared libraries:
ibreadline.so.6:cannot open shared object file :no such file or directory”
解決辦法:
檢視/lib/下的有可能有libreadline.so.6 ,可以做一個軟連結下載ncurses-5.6.tat.gz,進去編譯安裝。然後下載readline-5.2.tar.gz,解壓cd到其目錄執行一定要按照下面第順序,否則可能不成功。
$./configure --prefix=/usr --with-ncurses
$cd shlib
把Makefile裡的SHLIB_LIBS = 改為 SHLIB_LIBS = -lncurses
$make
$sudo make install
$cd ..
$make
$sudo make install
解決之後 用ldd命令探測 ldd /sbin/lvm
linux-vdso.so.1 => (0x00007fff3e7ff000)
libudev.so.0 => /lib64/libudev.so.0 (0x00000039b5c00000)
libdl.so.2 => /lib64/libdl.so.2 (0x00000039ad400000)
libdevmapper-event.so.1.02 => /lib64/libdevmapper-event.so.1.02 (0x00000039ad000000)
libdevmapper.so.1.02 => /lib64/libdevmapper.so.1.02 (0x00000039b7800000)
libreadline.so.6 => /usr/lib/libreadline.so.6 (0x00007fa8d90a0000)
libc.so.6 => /lib64/libc.so.6 (0x00000039acc00000)
/lib64/ld-linux-x86-64.so.2 (0x00000039ac800000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00000039ae800000)
libsepol.so.1 => /lib64/libsepol.so.1 (0x00000039b6800000)
libncurses.so.5 => /lib64/libncurses.so.5 (0x00000039ae400000)
libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00000039af400000)
發現 lvm命令依賴的共用庫 libreadline.so.6已經找到,問題解決,系統成功啟動。去/usr/lib路徑,發現libreadline.so的連線情況如下。
[root@www.linuxidc.com lib]# ll |grep libread
lrwxrwxrwx. 1 root root 16 2月 12 14:00 libreadline.so -> libreadline.so.6
lrwxrwxrwx. 1 root root 18 2月 12 14:00 libreadline.so.6 -> libreadline.so.6.3
-r-xr-xr-x. 1 root root 680132 2月 12 14:00 libreadline.so.6.3
參考文章:
CentOS 6.4中安裝JLink及出現問題解決 http://www.linuxidc.com/Linux/2013-11/92285.htm
相關文章