歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> 解決CentOS缺少共享庫:libstdc++.so.6

解決CentOS缺少共享庫:libstdc++.so.6

日期:2017/2/28 14:50:28   编辑:Linux教程

當在CentOS 6.2下執行某些命令時,有缺少共享庫的報錯:

error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

解決辦法:
1、執行命令: yum whatprovides libstdc++.so.6

然後會提示哪個安裝包有這個庫文件如下:

[root@localhost ~]# yum whatprovides libstdc++.so.6
Loaded plugins: aliases, changelog, downloadonly, fastestmirror, kabi, presto, refresh-packagekit, security, tmprepo, verify,
: versionlock
Loading support for CentOS kernel ABI
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* centosplus: centos.ustc.edu.cn
* contrib: centos.ustc.edu.cn
* extras: centos.ustc.edu.cn
* updates: centos.ustc.edu.cn
libstdc++-4.4.7-3.el6.i686 : GNU Standard C++ Library
Repo : base
Matched from:
Other : libstdc++.so.6

2、然後執行:

yum install libstdc++-4.4.7-3.el6.i686

搞定!

更多CentOS相關信息見CentOS 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=14

Copyright © Linux教程網 All Rights Reserved