bash: ./shank-linux-120720110-1-bin: No such file or directory
bash: ./shank-linux-120720110-1-bin: No such file or directory
file shank-linux-120720110-1-bin
显示类似“ELF 32-bit LSB executable…”的内容),但当你尝试执行它时,却被告知文件不存在。file
命令会告诉你这个二进制文件是什么。除了一些例外情况,你只能运行与你的Ubuntu版本相对应的处理器架构的二进制文件。主要的例外是,在64位(amd64,也称为x86_64)系统上可以运行32位(x86,也称为IA32)的二进制文件。ia32-libs
软件包ia32-libs
,但是您可以选择更精细的方法,只需获取libc6-i386
ldd
命令来检查是否缺少某个库文件。
在执行 ldd kgio_ext.so
时,可能会显示类似于 libruby.so.2.3 => not found
的信息,还有其他内容。 - EnabrenTanebash: ...some...path...: No such file or directory
* 可能会出现另一种情况。Bash似乎会缓存在$PATH中找到的可执行文件的路径;运行hash -r
来清除缓存。参考:http://unix.stackexchange.com/a/5610/11352 - akavelldd
返回了所有内容的匹配。不知道你是否了解其他导致可执行文件发出“找不到文件或目录”错误的原因,即使ldd
返回了一个完整的已解析的64位库列表。 - Scott Smith只有当file file-name
的输出显示如下时,请按照此答案操作:
file-name: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, not stripped
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
./file-name
libselinux1:i386
。 - Araloxsudo apt-get install lsb
。file lmutil
没有显示解释器,但是 ldd
显示了,并且安装 lsb
解决了这个问题。 - davidAinterpreter /lib64/ld-linux-x86-64.so.2
的加载。感谢这个补充! - Martin Dale Lyness$ ./myprogram
bash: myprogram: No such file or directory
$ file myprogram
myprogram: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.2.5, not stripped
$ ldd myprogram
not a dynamic executable
$ sudo apt-get install libc6:i386 # the initial fix
...
$ ldd myprogram
linux-gate.so.1 => (0xf77fd000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7626000)
/lib/ld-linux.so.2 (0x56578000)
$ ./myprogram
myprogram: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
完成任务,您可能需要逐个识别和安装额外的库...
$ sudo apt-get install libstdc++6:i386 ## may require various additional libs
$ ./myprogram
... works correctly ...
ldd
(错误地)报告“不是动态可执行文件”。 - Brent Bradburnsudo apt-get install -f
然后我又遇到了另一个错误:
Message: SDL_GL_LoadLibrary
Error: Failed loading libGL.so.1
libgl1-mesa-glx:i386
libgl1-mesa-dri: i386.
谷歌将我导航到了这个页面。我的问题与该主题的标题有些关联,所以我在这里发帖给像我一样的未来访客:
这是一个非常奇怪的问题:
$ ls -lh
ls: cannot access .~dataprep.ipynb: No such file or directory
-????????? ? ? ? ? ? .~dataprep.ipynb
-rw------- 1 tgowda mygroup 475K Jun 12 15:59 dataprep.ipynb
.~dataprep.ipynb
就在那里,有一些奇怪的??
权限。
我只是想摆脱那个乱七八糟的文件。
rm
命令无法删除它。mv
命令也无法移动它。$ python
>>> from pathlib import Path
>>> list(Path('.').glob("*.ipynb"))
[PosixPath('.~dataprep.ipynb'), PosixPath('dataprep.ipynb')]
>>> p = list(Path('.').glob("*.ipynb"))[0]
>>> p
PosixPath('.~dataprep.ipynb')
>>> p.unlink()
>>> list(Path('.').glob("*.ipynb"))
[PosixPath('dataprep.ipynb')]
以上答案都对我没有用,因为解释器发生了错误解析。
我已经在这里写了一个详细的答案,解释如何解决这个问题。
所以,简而言之,您需要通过在终端中运行以下命令(Ctrl + Alt + T)来创建一个指向不存在的解释器路径的链接:Thanks to this man who shared his experience with others solution here. thanks to him i was able to solve this problem.
To summarize, as @steeldriver though, there was an interpreter problem. the linker is giving to my program [/lib/ld64.so.1] as ELF interpreter but this path doesnt exist at all and i checked it by:
> ls /lib/ld64.so.1 ls: cannot access '/lib/ld64.so.1': No such file or directory
After that, i checked the interpreters path's on my ubuntu installation by:
> ls /lib64/ld-* /lib64/ld-linux-x86-64.so.2 /lib64/ld-lsb-x86-64.so.2 /lib64/ld-lsb-x86-64.so.3
so the solution is to create a link of one of this interpreters to the inexistant interpreter path by:
sudo ln -s /lib64/ld-linux-x86-64.so.2 /lib/ld64.so.1
Now we re-check the inexistent interpreter one more time to see if its still inexisting or not:
> ls /lib/ld64.so.1 /lib/ld64.so.1
Now this command has returned /lib/ld64.so.1 instead of "inexistant file". so the problem was solved and i could run ./main successfully
sudo ln -s /lib64/ld-linux-x86-64.so.2 /lib/ld64.so.1
bash -x scriptname.sh
来追踪错误。 - Avatar