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