centos缺少共享库:libstdc++.so.6

分类:CentOS运维 阅读:18278 次

执行某些命令时,有缺少共享库的报错:

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

解决办法:

1、执行命令: yum whatprovides libstdc++.so.6

admin@rocketmq-master1 ~]# yum whatprovides libstdc++.so.6

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

* base: tlinux-mirror.tencent-cloud.com

* cr: tlinux-mirror.tencent-cloud.com

* fasttrack: tlinux-mirror.tencent-cloud.com

* tlinux: tlinux-mirror.tencent-cloud.com

* tlinux-debuginfo: tlinux-mirror.tencent-cloud.com

* updates: tlinux-mirror.tencent-cloud.com

base | 2.7 kB 00:00

cr | 3.0 kB 00:00

fasttrack | 3.5 kB 00:00

tlinux | 3.2 kB 00:00

tlinux/primary_db | 589 kB 00:00

tlinux-debuginfo | 3.2 kB 00:00

tlinux-debuginfo/primary_db | 34 kB 00:00

updates | 3.6 kB 00:00

libstdc++-4.4.6-3.el6.i686 : GNU Standard C++ Library

Repo : base

Matched from:

Other : libstdc++.so.6

libstdc++-4.4.6-4.tl1.i686 : GNU Standard C++ Library

Repo : tlinux

Matched from:

Other : libstdc++.so.6

libstdc++-4.4.6-4.tl1.i686 : GNU Standard C++ Library

Repo : installed

Matched from:

Other : Provides-match: libstdc++.so.6

2.yum install -y libstdc++-4.4.6-4.tl1.i686

如果系统中存在低版本的64位库,则会因为版本不一致而报错

报错:

--> Finished Dependency Resolution

Error: Protected multilib versions: libstdc++-4.4.6-4.el6.i686 != libstdc++-4.4.6-3.el6.x86_64

You could try using --skip-broken to work around the problem

You could try running: rpm -Va --nofiles --nodigest

可先升级相应64位库再安安装32位库

yum update libstdc++-4.4.6-3.el6.x86_64