zoukankan      html  css  js  c++  java
  • centos7.5 解决缺少libstdc++.so.6库的原因及解决办法

    centos7.5 解决缺少libstdc++.so.6库的原因及解决办法
    
    执行node -v报错如下:
    
    [root@bogon ~]# node -v
    node: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
    
    先加载所有安装包
    
    yum repolist
    
    
    查看哪个安装包包含该库:
    
    yum provides libstdc++.so.6
    
    执行结果:
    
    [root@bogon ~]# yum whatprovides libstdc++.so.6
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirrors.njupt.edu.cn
     * extras: mirrors.163.com
     * updates: mirrors.njupt.edu.cn
    libstdc++-4.8.5-36.el7.i686 : GNU Standard C++ Library
    Repo        : base
    Matched from:
    Provides    : libstdc++.so.6
    
    
    可以看到安装包 libstdc++-4.8.5-36.el7.i686
    
    
    安装libstdc++-4.8.5-36.el7.i686
    
    yum -y install libstdc++-4.8.5-28.el7.x86_64
    
    报错:
    
           ...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).
           
           Protected multilib versions: libstdc++-4.8.5-36.el7.i686 != libstdc++-4.8.5-28.el7.x86_64
    
    
    解决办法:
    
    1、升级安装包
    
    yum  update libstdc++-4.8.5-28.el7.x86_64 -y
    
    
    2、修复/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory问题
    
    yum install glibc.i686 -y
    
    3、 修复error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
    
    yum install zlib.i686 -y
    
    
    4、修复error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
    
    先查找这个库存在于哪个安装包中
    
    yum whatprovides libstdc++.so.6
    
    执行结果:
    
    [root@bogon ~]# yum whatprovides libstdc++.so.6
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirrors.njupt.edu.cn
     * extras: mirrors.163.com
     * updates: mirrors.njupt.edu.cn
    libstdc++-4.8.5-36.el7.i686 : GNU Standard C++ Library
    Repo        : base
    Matched from:
    Provides    : libstdc++.so.6
    
    
    可以看到包  libstdc++-4.8.5-36.el7.i686
    
    
    安装libstdc++-4.8.5-36.el7.i686
    
    yum install libstdc++-4.8.5-36.el7.i686 -y
    
    
    到此就解决了缺少共享库到问题
    
    
    
    参照文档:
    
    https://blog.csdn.net/qiaoliang328/article/details/79266008
  • 相关阅读:
    电商项目(上)
    Java开发快速上手
    iOS 总结网页常用的东西
    osstatus -9801 workerman websocket 小程序不带端口
    ListView+EditText使用遇到的坑
    关于微信浏览器不支持offset()的兼容性处理
    关于TS返回 Can't use function return value in write context 问题
    tableView刷新中的问题
    解决 ecshop 搜索特殊字符关键字(如:*,+,/)导致搜索结果乱码问题
    新用户注册用户名可以被修改导致其他平台出现相关问题
  • 原文地址:https://www.cnblogs.com/effortsing/p/10363921.html
Copyright © 2011-2022 走看看