最近在使用Linux操作系统执行一个可执行文件,结果出现了No such file or directory的提示。
查看文件信息,可以看到文件是存在的,并且是可以执行的。
查阅资料后,原因是系统位数与该可执行文件需要的lib库位数不匹配。
用uname -a 命令打印系统信息,发现系统是64位系统。
用file命令查看文件信息,发现是一个32位可执行文件。
要想在64位系统上运行32位程序,则需要安装32位lib库。
对于Ubuntu用户可以使用下面的命令安装。
sudo apt-get install ia32-libs
Reading package lists...
Done
Building dependency tree
Reading state information...
Done
Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source,However the following packages replace it:
lib32z1 lib32ncurses5 lib32bz2-1.0
过程中有可能找不到需要的库,但是会有几个替代包,提示选择安装其中一个,比如。
sudo apt-get install lib32z1
然后就可以正常运行之前的可执行文件了。
来源参考:
https://blog.csdn.net/zhuyong006/article/details/95101862