Linux执行可执行文件提示No such file or directory的解决方法

最近在使用Linux操作系统执行一个可执行文件,结果出现了No such file or directory的提示,表示很疑惑。

./tshrf

bash: ./tshref: No such file or directory

查看文件信息,可以看到文件是存在的,并且是可以执行的。

-rwxr-xr-x 1 yuan yuan 20581  4月 29  2004 tshref

查阅资料后,原因是系统位数与该可执行文件需要的lib库位数不匹配。

用uname命令打印系统信息,发现系统是64位系统

uname -a

Linux yuan-vm 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

用file命令查看文件信息,发现是一个32位可执行文件。

file ./tshref

./tshref: ELF 32-bit LSB  executable, Intel 80386, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.2.5, not stripped

要想在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 lib32bz2-1.0

lib32bz2-1.0

然后就可以正常运行之前的可执行文件了。

遇到这种问题其实还有可能是其他原因,例如文本的编码格式问题等,本文仅提出了一种解决方法,读者遇到相同问题要具体问题具体分析。

时间: 2024-07-30 13:52:53

Linux执行可执行文件提示No such file or directory的解决方法的相关文章

linux sh文件提示 no such file or directory

Linux执行.sh文件,提示No such file or directory的问题的解决方法 12-06-28 16:59作者:love__coder Linux执行.sh文件,提示No such file or directory的问题 问题描述 解决方法 分析原因,可能因为我平台迁移碰到权限问题我们来进行权限转换 1)在Windows下转换: 利用一些编辑器如UltraEdit或EditPlus等工具先将脚本编码转换,再放到Linux中执行.转换方式如下(UltraEdit):File-

64位linux系统无法运行Android sdk的adb和aapt,提示No such file or directory的解决办法

参考资料: http://askubuntu.com/questions/147400/problems-with-eclipse-and-android-sdk http://serverfault.com/questions/442792/ubuntu-12-04-apt-get-install-ia32-libs-unmet-dependencies http://my.oschina.net/uoy/blog/129108 本人在64位Debian上运行Android sdk目录下的ad

Ubuntu&Linux系统出现文件系统只读Read-only file system 的快速解决方法

问题描述: 周末运行盘平台服务程序,周一来操作系统卡顿,主进程已退出,重启进程时提示Read-only file system:新建目录和其他chmod -R等等操作都提示Read-only file system. 问题原因: 重启系统,提示根分区error,原因是磁盘出现文件系统错误. 解决方法: 使用fsck手动修复,具体操作如下: 切换到root用户,运行fsck.ext4 -y /dev/vdb1 说明:文件系统采用fsck.ext4,/dev/vdb1是系统/根分区.运行完毕后reb

Android 开发环境jdk配置 执行javac提示不是内部或外部命令解决方法

'JAVAC' 不是内部或外部命令,也不是可运行的程序 或批处理文件.问题解决方法分享! 'JAVA' 不是内部或外部命令,也不是可运行的程序 或批处理文件解决办法相似. 原因一:没有安装jdk,只安装了jre 1 jdk1.7.0_60+jre才是完整的,如果没有安装jdk的话,在cmd里边输入javac就会提示"'JAVAC' 不是内部或外部命令,也不是可运行的程序 或批处理文件" 步骤阅读 2 解决方法是安装jdk END 百度经验:jingyan.baidu.com 安装了JD

Qt编译错误“GL/gl.h:No such file or directory”的解决方法

备注:1)操作系统:Ubuntu-14.04或12.042)Linux用户:root3)Qt版本:qt-linux-opensource-5.2.0-x86 为了迎接Qt的新纪元(从诺基亚移居到芬兰公司Digia家中),我决定将Qt开发环境升级到当前的最新版5.2,在安装好开发环境后,编译第一个工程的时候出现了如下错误:"GL/gl.h:No such file or directory",这是由于系统中没有安装OpenGL库导致的,于是在控制台中输入以下命令安装OpenGL库及其工具

【linux】——FTP出现500 OOPS: cannot change directory的解决方法

cannot change directory:/home/*** ftp服务器连接失败,错误提示: 500 OOPS: cannot change directory:/home/******* 500 OOPS: child died 解决方法: 在终端输入命令: setsebool -P ftpd_disable_trans 1 service vsftpd restart 就OK了! 原因:这是因为服务器开启了selinux,这限制了FTP的登录.

bash: ./make_ext4fs: No such file or directory 错误解决方法

一般出现该错误是因为应用程序是32位导致的,能够使用file命令来查看: [email protected]:~/Desktop$ file make_ext4fs make_ext4fs: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, not stripped [email protected]:~/Des

FileNotFoundError: [Errno 2] No such file or directory的解决方法

1.获取当前文件所在路径 basedir = os.path.dirname(__file__) print("basedir:" + basedir) 2.将路径进行拼接 upload_path = os.path.join(basedir, "static/upload", filename) 原文地址:https://www.cnblogs.com/zengsf/p/9882824.html

win10安装git fatal: open /dev/null or dup failed: No such file or directory错误解决方法

原因看大家意思应该是 非即插即用驱动文件null.sys问题. 网上有很多方案.最后试了一个可行的. 替换  windows/system32/drivers/null.sys为网盘中的文件,之后重启电脑即可. 链接:https://pan.baidu.com/s/1x6udo42W9GiAiw3HE6Xc4A 提取码:x8lr 原文地址:https://www.cnblogs.com/cxfs/p/10235833.html