apt-get 没有在 /usr/lib 中查找 libstdc++.so.6

apt-get 没有在 /usr/lib 中查找 libstdc++.so.6

我遇到了一个比较常见的"GLIBXX_3.4.15 not found"错误。但就我而言,我看到了一些非常奇怪的事情。

通常错误出现如下形式:

/usr/lib/libstdc++.so.6: version 'GLIBCXX_3.4.15' not found

我的看起来像这样:

/opt/smrtanalysis/current/analysis/lib/libstdc++.so.6: version 'GLIBCXX_3.4.15' not found

许多解决方案(这里这里, 或者这里)建议尝试一些方法apt-get -f install来纠正它(或通过重新安装apt-get),但是当我尝试运行 apt 时出现了这个错误。

我已将/usr/lib、、、和添加到我的/usr/local/lib,但仍然没有成功。/usr/lib/x86_64-linux-gnu/usr/lib/i386-linux-gnuLD_LIBRARY_PATH

最终,我发现了一个尝试使用dpkg --remove libstdc++6并手动安装的建议,但这给了我这个错误:

dpkg: dependency problems prevent removal of libstdc++6:
...
insert long list of programs that depend on libstdc++6
...
dpkg: error processing libstdc++6 (--remove):
 dependency problems - not removing
Errors were encountered while processing:
 libstdc++6

因此我尝试从 .deb 重新安装,想着也许可以解决路径问题,结果得到了:

Preparing to replace libstdc++6 4.6.3-1ubuntu5 (using libstdc++6_4.6.3-1ubuntu5_amd64.deb) ...
Unpacking replacement libstdc++6 ...
dpkg: error processing libstdc++6 (--install):
 libstdc++6:amd64 4.6.3-1ubuntu5 cannot be configured because libstdc++6:i386 is in a different version (4.8.1-2ubuntu1~12.04)
Errors were encountered while processing:
 libstdc++6

所以我放弃了这个想法,而是locate libstdc++.so创建一个新链接/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16并将其复制到那里/opt/smrtanalysis/current/analysis/lib/以替换错误的libstdc++.so.6链接(保存旧链接,以防万一)。现在apt-get -f install告诉我:

The following extra packages will be installed:
  libstdc++6
The following packages will be upgraded:
  libstdc++6
1 upgraded, 0 newly installed, 0 to remove and 111 not upgraded.
2 not fully installed or removed.
Need to get 0 B/326 kB of archives.
After this operation, 21.5 kB of additional disk space will be used.
Do you want to continue [Y/n]?

这看起来像是进步了,但是却y得到了以下结果:

/usr/bin/perl: symbol lookup error: /opt/smrtanalysis/current/miscdeps/basesys/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/auto/IO/IO.so: undefined symbol: Perl_Tstack_sp_ptr
(Reading database ... 210954 files and directories currently installed.)
Preparing to replace libstdc++6 4.6.3-1ubuntu5 (using .../libstdc++6_4.8.1-2ubuntu1~12.04_amd64.deb) ...
Unpacking replacement libstdc++6 ...
dpkg: error processing /var/cache/apt/archives/libstdc++6_4.8.1-2ubuntu1~12.04_amd64.deb (--unpack):
 './usr/share/doc/libstdc++6' is different from the same file on the system
Errors were encountered while processing:
 /var/cache/apt/archives/libstdc++6_4.8.1-2ubuntu1~12.04_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我不知道 smrtanalysis 在安装时做了什么,竟然对路径造成了如此大的干扰,也不知道如何让 apt 查看usr/libs。有什么建议吗?

编辑

追溯依赖关系我发现了以下情况:

ldd /usr/bin/apt-get
    linux-vdso.so.1 =>  (0x00007fff65c38000)
    libapt-pkg.so.4.12 => /usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12 (0x00007fce5b5a6000)
    libstdc++.so.6 => /opt/smrtanalysis/current/analysis/lib/libstdc++.so.6 (0x00007fce5b2a2000)
    libgcc_s.so.1 => /opt/smrtanalysis/current/analysis/lib/libgcc_s.so.1 (0x00007fce5b08c000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fce5acae000)
    libutil.so.1 => /opt/smrtanalysis/current/misclibs/sys-root/lib/libutil.so.1 (0x00007fce5aaab000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fce5a8a7000)
    libz.so.1 => /opt/smrtanalysis/current/common/lib/libz.so.1 (0x00007fce5a688000)
    libm.so.6 => /opt/smrtanalysis/current/misclibs/sys-root/lib/libm.so.6 (0x00007fce5a405000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fce5b8d1000)

对于 PERL

 ldd /usr/bin/perl
    linux-vdso.so.1 =>  (0x00007fff707ff000)
    libperl.so.5.14 => /usr/lib/libperl.so.5.14 (0x00007fbc3b501000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fbc3b142000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fbc3af3e000)
    libm.so.6 => /opt/smrtanalysis/current/misclibs/sys-root/lib/libm.so.6 (0x00007fbc3acba000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fbc3aa9d000)
    libcrypt.so.1 => /opt/smrtanalysis/current/misclibs/sys-root/lib/libcrypt.so.1 (0x00007fbc3a865000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fbc3b89f000)

关于如何撤消依赖性变化有什么想法吗?

答案1

我最终深入研究/etc/bash.bashrc并注释掉了所有带有该内容的条目,/opt/smrtanalysis/...然后一切恢复正常。

相关内容