centos7.6 解决缺少libstdc++.so.6库的原因及解决办法

2022/11/15 libstdc++.so.6centos

# /lib/ld-linux.so.2: bad ELF interpreter解决

  bash: /usr/local/bin/rar: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
1

是因为64位系统中安装了32位程序 解决方法:

yum install glibc.i686
1

重新安装以后还有如下类系错误 再继续安装包

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

执行如下命令:

yum install libstdc++.so.6
1

# 问题浮现

  1. 报错信息
[root@iZ2ze70u722r351425kefzZ /]# yum install libstdc++.so.6
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
正在解决依赖关系
--> 正在检查事务
---> 软件包 libstdc++.i686.0.4.8.5-44.el7 将被 安装
--> 正在处理依赖关系 libgcc_s.so.1(GLIBC_2.0),它被软件包 libstdc++-4.8.5-44.el7.i686 需要
--> 正在处理依赖关系 libgcc_s.so.1(GCC_4.2.0),它被软件包 libstdc++-4.8.5-44.el7.i686 需要
--> 正在处理依赖关系 libgcc_s.so.1(GCC_3.3),它被软件包 libstdc++-4.8.5-44.el7.i686 需要
--> 正在处理依赖关系 libgcc_s.so.1(GCC_3.0),它被软件包 libstdc++-4.8.5-44.el7.i686 需要
--> 正在处理依赖关系 libgcc_s.so.1,它被软件包 libstdc++-4.8.5-44.el7.i686 需要
--> 正在检查事务
---> 软件包 libgcc.x86_64.0.4.8.5-36.el7_6.2 将被 升级
---> 软件包 libgcc.i686.0.4.8.5-44.el7 将被 安装
---> 软件包 libgcc.x86_64.0.4.8.5-44.el7 将被 更新
--> 解决依赖关系完成
错误: Multilib version problems found. This often means that the root
      cause is something else and multilib version checking is just
      pointing out that there is a problem. Eg.:
      
        1. You have an upgrade for libstdc++ which is missing some
           dependency that another package requires. Yum is trying to
           solve this by installing an older version of libstdc++ of the
           different architecture. If you exclude the bad architecture
           yum will tell you what the root cause is (which package
           requires what). You can try redoing the upgrade with
           --exclude libstdc++.otherarch ... this should give you an error
           message showing the root cause of the problem.
      
        2. You have multiple architectures of libstdc++ installed, but
           yum can only see an upgrade for one of those architectures.
           If you don't want/need both architectures anymore then you
           can remove the one with the missing update and everything
           will work.
      
        3. You have duplicate versions of libstdc++ installed already.
           You can use "yum check" to get yum show these errors.
      
      ...you can also use --setopt=protected_multilib=false to remove
      this checking, however this is almost never the correct thing to
      do as something else is very likely to go wrong (often causing
      much more problems).
      
      保护多库版本:libstdc++-4.8.5-44.el7.i686 != libstdc++-4.8.5-36.el7_6.2.x86_64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
  1. 升级
 yum update libstdc++-4.8.5-36.el7_6.2.x86_64 -y
1
  1. 查看哪里包含文件
[root@iZ2ze70u722r351425kefzZ /]# yum whatprovides libstdc++.so.6
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
libstdc++-4.8.5-44.el7.i686 : GNU Standard C++ Library
源    :base
匹配来源:
提供    :libstdc++.so.6

1
2
3
4
5
6
7
8
  1. 安装
[root@iZ2ze70u722r351425kefzZ /]# yum install libstdc++-4.8.5-44.el7.i686 -y
1
最后更新时间: 2023/1/12 15:59:09