简体   繁体   English

安装rpm时如何指向较新版本的gcc库

[英]How to point to the newer version of gcc libs when installing rpms

I am trying to install Chrome on my Centos 6.4. 我正在尝试在Centos 6.4上安装Chrome。 The stock gcc is 4.4.6, so I installed 4.7.3 in /opt/gcc-4.7.3 myself. 库存的gcc是4.4.6,所以我自己在/opt/gcc-4.7.3中安装了4.7.3。 Also added /opt/gcc-4.7.3/bin to PATH and prepended /opt/gcc-4.7.3/lib64 to LD_LIBRARY_PATH where libstdc++.so.6 is located. 还将/opt/gcc-4.7.3/bin添加到PATH,并将/opt/gcc-4.7.3/lib64添加到libstdc ++。so.6所在的LD_LIBRARY_PATH。 However when I install chrome rpm, still got the same error: 但是,当我安装chrome rpm时,仍然出现相同的错误:

rpm -ivh google-chrome-stable_current_x86_64.rpm 
warning: google-chrome-stable_current_x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 7fac5991: NOKEY
error: Failed dependencies:
    libstdc++.so.6(GLIBCXX_3.4.15)(64bit) is needed by google-chrome-stable-34.0.1847.132-1.x86_64

It clearly shows that GLIBCXX_3.4.15 is there: 它清楚地表明存在GLIBCXX_3.4.15:

/opt/gcc-4.7.3/lib64/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_FORCE_NEW
GLIBCXX_FORCE_NEW
GLIBCXX_DEBUG_MESSAGE_LENGTH

How do I force installer to look at the newer version libstdc++.so.6? 如何强制安装程序查看更新的版本libstdc ++。so.6?

RPM only knows about software installed by RPM and registered in the RPMDB. RPM仅知道RPM安装并在RPMDB中注册的软件。 Installing other versions of software in arbitrary locations doesn't mean RPM knows about it. 在任意位置安装其他版本的软件并不意味着RPM知道它。

Your options are to install a newer GCC via RPM or install chrome using the --nodeps option, which tells RPM not to check dependencies. 您的选择是通过RPM安装较新的GCC或使用--nodeps选项安装chrome,这告诉RPM不要检查依赖项。 If you choose the second approach then it's your responsibility to make sure the libraries will be found at runtime, eg by setting LD_LIBRARY_PATH or some other method such as adding the directory to the ldconfig cache. 如果选择第二种方法,则有责任确保在运行时找到库,例如,通过设置LD_LIBRARY_PATH或其他方法(例如将目录添加到ldconfig高速缓存)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM