无法运行 evince。提示缺少共享库

无法运行 evince。提示缺少共享库

当尝试启动 evince 时,Ubuntu 12.04 响应我:

% evince
evince: error while loading shared libraries: libSM.so.6: cannot open shared object file: No such file or directory

另一方面ldd报告没有问题。

% ldd /usr/bin/evince
    linux-vdso.so.1 =>  (0x00007fffa15ff000)
    libSM.so.6 => /usr/lib/x86_64-linux-gnu/libSM.so.6 (0x00007f57bdb04000)
    libICE.so.6 => /usr/lib/x86_64-linux-gnu/libICE.so.6 (0x00007f57bd8ea000)
    libevdocument3.so.4 => /usr/lib/libevdocument3.so.4 (0x00007f57bd6b5000)
        ...

我猜想一定是加载共享库出了问题。libSM这只是第一个问题。要求 Ubuntu 更详细一点也没给我带来任何想法。

% export LD_DEBUG=all
% evince
      6574: 
      6574: file=libSM.so.6 [0];  needed by evince [0]
      6574: find library=libSM.so.6 [0]; searching
      6574:  search cache=/etc/ld.so.cache <----- why not found?
      6574:  search path=/lib/x86_64-linux-gnu/tls/x86_64:/lib/x86_64-linux-gnu/tls:/lib/x86_64-linux-gnu/x86_64:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu/tls/x86_64:/usr/lib/x86_64-linux-gnu/tls:/usr/lib/x86_64-linux-gnu/x86_64:/usr/lib/x86_64-linux-gnu:/lib/tls/x86_64:/lib/tls:/lib/x86_64:/lib:/usr/lib/tls/x86_64:/usr/lib/tls:/usr/lib/x86_64:/usr/lib        (system search path)
      6574:   trying file=/lib/x86_64-linux-gnu/tls/x86_64/libSM.so.6
      6574:   trying file=/lib/x86_64-linux-gnu/tls/libSM.so.6
      6574:   trying file=/lib/x86_64-linux-gnu/x86_64/libSM.so.6
      6574:   trying file=/lib/x86_64-linux-gnu/libSM.so.6
      6574:   trying file=/usr/lib/x86_64-linux-gnu/tls/x86_64/libSM.so.6
      6574:   trying file=/usr/lib/x86_64-linux-gnu/tls/libSM.so.6
      6574:   trying file=/usr/lib/x86_64-linux-gnu/x86_64/libSM.so.6
      6574:   trying file=/usr/lib/x86_64-linux-gnu/libSM.so.6 <----- why it fails?
      6574:   trying file=/lib/tls/x86_64/libSM.so.6
      6574:   trying file=/lib/tls/libSM.so.6
      6574:   trying file=/lib/x86_64/libSM.so.6
      6574:   trying file=/lib/libSM.so.6
      6574:   trying file=/usr/lib/tls/x86_64/libSM.so.6
      6574:   trying file=/usr/lib/tls/libSM.so.6
      6574:   trying file=/usr/lib/x86_64/libSM.so.6
      6574:   trying file=/usr/lib/libSM.so.6
      6574: 
evince: error while loading shared libraries: libSM.so.6: cannot open shared object file: No such file or directory  

% unset LD_DEBUG
% ls -l /usr/lib/x86_64-linux-gnu/libSM.so.6
lrwxrwxrwx 1 root root 14 lip 25  2012 /usr/lib/x86_64-linux-gnu/libSM.so.6 -> libSM.so.6.0.1
% ls -l /usr/lib/x86_64-linux-gnu/libSM.so.6.0.1 
-rw-r--r-- 1 root root 30888 mar  2  2012 /usr/lib/x86_64-linux-gnu/libSM.so.6.0.1

仅 evince 出现问题。其他程序运行正常。

再生/etc/ld.so.cache不会改变任何事情。

% ldconfig
% ls -l /etc/ld.so.cache 
-rw-r--r-- 1 root root 84443 lis  6 17:17 /etc/ld.so.cache
% evince
evince: error while loading shared libraries: libSM.so.6: cannot open shared object file: No such file or directory

gv也依赖于libSM并且运行没有问题。让我们比较一下

% gv
6605:     
      6605:     file=libXaw3d.so.6 [0];  needed by gv [0]
      6605:     find library=libXaw3d.so.6 [0]; searching
      6605:      search cache=/etc/ld.so.cache
      6605:       trying file=/usr/lib/x86_64-linux-gnu/libXaw3d.so.6
      6605:     
      6605:     file=libXaw3d.so.6 [0];  generating link map
      6605:       dynamic: 0x00007f1b68327b88  base: 0x00007f1b680d5000   size: 0x000000000025e560
      6605:         entry: 0x00007f1b680ea9e0  phdr: 0x00007f1b680d5040  phnum:                  7
      6605:     
...
      6605:     file=libSM.so.6 [0];  needed by /usr/lib/x86_64-linux-gnu/libXt.so.6 [0]
      6605:     find library=libSM.so.6 [0]; searching
      6605:      search cache=/etc/ld.so.cache
      6605:       trying file=/usr/lib/x86_64-linux-gnu/libSM.so.6
      6605:     
      6605:     file=libSM.so.6 [0];  generating link map
      6605:       dynamic: 0x00007f1b66e4fdb8  base: 0x00007f1b66c49000   size: 0x0000000000207158
      6605:         entry: 0x00007f1b66c4ab20  phdr: 0x00007f1b66c49040  phnum:                  7
      6605:     
...

在这里,加载器在其缓存中找到条目。

答案1

我们可以在 12.04 系统上重现此问题

/usr/lib符号链接(从 ext4 挂载/)到/usr1/lib(ext3 挂载/usr1

搬入/usr1/lib即可/usr解决问题。

gv这种情况只发生在 evince 上,不会发生在其他使用 libSM 的程序上

原始海报是否也具有拆分挂载/不同的文件系统?

相关内容