在Linux系统上执行生成PDF文件命令时,系统报了下面的错误:
error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
究其原因就是在64位系统安装32位软件,需要有32位库。那么来查看哪个安装包下有这个库:
yum whatprovides libstdc++.so.6
出来这样的提示,看样子libstdc++-4.8.5-39.el7.i686提供这个库:
执行安装:
yum install libstdc++-4.8.5-39.el7.i686
此时系统报了一长串错误,如下:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
base | 3.6 kB 00:00:00
epel | 5.3 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/2): epel/x86_64/updateinfo | 1.0 MB 00:00:00
(2/2): epel/x86_64/primary_db | 6.7 MB 00:00:00
Resolving Dependencies
--> Running transaction check
---> Package libstdc++.i686 0:4.8.5-39.el7 will be installed
--> Processing Dependency: libgcc_s.so.1(GLIBC_2.0) for package: libstdc++-4.8.5-39.el7.i686
--> Processing Dependency: libgcc_s.so.1(GCC_4.2.0) for package: libstdc++-4.8.5-39.el7.i686
--> Processing Dependency: libgcc_s.so.1(GCC_3.3) for package: libstdc++-4.8.5-39.el7.i686
--> Processing Dependency: libgcc_s.so.1(GCC_3.0) for package: libstdc++-4.8.5-39.el7.i686
--> Processing Dependency: libgcc_s.so.1 for package: libstdc++-4.8.5-39.el7.i686
--> Running transaction check
---> Package libgcc.x86_64 0:4.8.5-36.el7_6.2 will be updated
---> Package libgcc.i686 0:4.8.5-39.el7 will be installed
---> Package libgcc.x86_64 0:4.8.5-39.el7 will be an update
--> Finished Dependency Resolution
Error: 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).
Protected multilib versions: libstdc++-4.8.5-39.el7.i686 != libstdc++-4.8.5-36.el7_6.2.x86_64
问题的关键出现在最后一句:Protected multilib versions: libstdc++-4.8.5-39.el7.i686 != libstdc++-4.8.5-36.el7_6.2.x86_64
应该是版本库不一致吧,先更新一下64位的库:
yum update libstdc++-4.8.5-36.el7_6.2.x86_64
然后再安装:
yum install libstdc++.i686
待安装完毕后,再执行生成PDF命令,终于成功了,如果还不行,也可参考这位博友的做法https://www.cnblogs.com/dashwood/p/11531585.html,详见第四部分