Is this a problem with my distro or the application? - linux

I hope someone can help me with this :)
I am running Arch Linux and am trying to get a game to work (Penumbra Overture). I have downloaded the executable, checked the md5 and they match, installed it in a directory. However when I try to execute the file an error appears saying:
bash: ./penumbra.bin: No such file or directory
It does exist, I am in the right folder and it is set as executable:
-rwxr-xr-x 1 kumagoro users 6814000 Apr 15 2010 penumbra.bin
file penumbra.bin says:
penumbra.bin: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, stripped
ldd penumbra.bin says:
not a dynamic executable
So, is this a problem with my distro or the application?
Thanks

You are missing the interpreter for the binary. Check with
readelf -a penumbra.bin | grep -i program.interp
what it wants.

Related

How do I run an extensionless (maybe ELF) file on Ubuntu?

I was given a "binary" file on linux and a seperate file for windows for a particular task. The programs is an exe on windows. A linux version of the file has the same function on linux as it had windows, too.
However, I've failed to be able to execute this. I tried (on the terminal) to execute it by just the file name, ./[filename], and even tried chmod +x [filename] and then tried the second way.
For everything... I get the result: "Command not found". (The file is definitely there, by the way).
What am I supposed to do? The file command on it yields:
ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=e805f746e65c09cc8b0c037d8a8c27ee0a6a051c
My guess is that this is 32 bit compile on a 64 bit system. I cross compiled a small c file into a binary using the -m32 option on gcc. This also needed a few extra packages. The resulting a.out looks like this.
% file a.out
a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=be02470c8337b96e7deaaff323bc53865991c3ab, not stripped
Compare this to a native system binary
% file /bin/ls
/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=a0823e17cafbe5b2296346216445566840fdfd88, stripped
Running the a.out shows me this.
% ./a.out
zsh: no such file or directory: ./a.out
The specific "Command not found" message is something, I think, bash prints. I use zsh myself.
To get this to work, you can install the multilib packages. I didn't narrow it down to the exact package but installing gcc-multilib on Debian pulls in everything you need. After installing that, here's what I get.
% ./a.out
3.140523
(the program is supposed to estimate the value of PI).
Note: I actually needed to install gcc-multilib just to compile the file. I then uninstalled the packages to mimic a 64 bit system that doesn't have the 32 bit runtime libraries that the thing needs.
does the a.out have executable permission ?
check with ls -la cmd and if does no then add the permission using chmod a+x a.out an d then try executing

Cannot execute binary file on Ubuntu ./webupdater

I have downloaded "precompiled sample for GTK2" from here http://wxcode.sourceforge.net/components/webupdate/ on Ubuntu machine.
I extracted this, and it creates a folders "simple/v1.0.0" which contains executable file "webupdater".
When I run this command on terminal s5#s5-desktop:~/ble/simple/v1.0.0$ ./webupdater
-bash: ./webupdater: cannot execute binary file
it says can not execute binary file.
configuration of Ubuntu machine is given below.
s5#s5-desktop:~$ uname -a
Linux s5-desktop 3.5.0-23-generic #35~precise1-Ubuntu SMP Fri Jan 25 17:15:33 UTC 2013 i686 i686 i386 GNU/Linux
Please help, Why this problem is coming.
Thanks and Regards
Brajesh...
Are you running a 32 or 64 bit Ubuntu ? - check tha with the command :
uname -m
EG: "x86_64" is 64 bit, and "i686" is 32 bit.
Run the file command to see what the executable is :
file /bin/ls
These threads discuss this -
http://ubuntuforums.org/showthread.php?t=1919786
https://askubuntu.com/questions/359156/how-do-you-run-a-32-bit-program-on-a-64-bit-version-of-ubuntu
I am in Ubuntu 14.10, which no longer has ia32-libs, which used to fix this.
I have yet to find a solution to running a binary that is not installed.
In my case I am going to have to look at compiling the app on my system, and I will try and feed back to the original developer...
There can be many reasons:
Check the file permissions, do chmod 777 webupdater and then try executing again,
Check the type of file by executing file webupdater and compare it with your system uname -r , ie wether both are 32-bit, 64-bit or not. the file webupdater output can give you more information.
When I executed file webupdater, it gives output given below
s5#s5-desktop:~/ble/simple/v1.0.0$ file webupdater
webupdater: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.4.0, stripped
and Ubuntu system is 32bit
thanks,
Brajesh...

what does "-sh: executable_path:not found" mean

i am trying to run an executable in linux shell ( OpenELEC on raspberry pi )
OpenELEC:~ # /storage/fingi/usr/lib/autossh/autossh
-sh: /storage/fingi/usr/lib/autossh/autossh: not found
What does the "not found" in this case mean ?
If i try to do ldd:
OpenELEC:~ # ldd /storage/fingi/usr/lib/autossh/autossh
/usr/bin/ldd: eval: line 1: /storage/fingi/usr/lib/autossh/autossh: not found
And if i do file:
OpenELEC:~ # file /storage/fingi/usr/lib/autossh/autossh
/storage/fingi/usr/lib/autossh/autossh: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=599207c47d75b62ede5f214f9322ae2a18643eb7, stripped
The file type is in correct format . But it wont work adn wont give more descriptive error msg either.
Since openELEC is very restrictive, i had copied the autossh executable from a raspbmc installation . I have done it for several other executables as well ( screen , boost libraries etc ) and they work fine .
Can anyone suggest what might be the issue?
Edit 1:
as was suggested, this is the output of file command on an executable ( also copied from raspbmc ) that is working:
OpenELEC:~ # file /storage/fingi/usr/bin/screen
/storage/fingi/usr/bin/screen: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=5c58f047a25caa2c51a81d8285b4f314abc690e7, stripped
What does the "not found" in this case mean ?
This usually means that the executable cannot find one or more (shared) libraries to satisfy its external symbols.
This usually happens when no libraries are stored in the initramfs, or there is a shared library missing that the executable needs.
This can also happen if the executable is built with a C library that is incompatible with the runtime library, e.g. uClibc versus glibc/eglibc.
strings executable | less is the quickest way to see the required libraries and external symbols that the executable requires.
Or
Recompile your program and use static linking by specifying the -static option.
Check that the file has been set to executable permissions with ls -l if it hasn't change with chmod +x /storage/fingi/usr/lib/autossh/autossh

"No such file or directory" when running app on linux arm target

I have a development kit ( Altera Cyclon V, Cortex A9) and I'm trying to run a simple app on it.
I'm using cygwin for cross compiling my code for ARM Linux (using soureforge toolchain for Linux ).
Steps :
build within cygwin : arm-linux-gcc dd.c -s -mcpu=cortex-a9 -s -o ddb
copy ddb to target and chmod a+x
running it gives me "./ddb: No such file or directory" .
probably a mismatch between lib\tools but I'm new to Linux ( coming from QNX ).
Target is running :
root#socfpga:~/altera# cat /proc/version
Linux version 3.9.0 (jdasilva#sj-interactive3) (gcc version 4.7.3 20121106 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2012.1
1-20121123 - Linaro GCC 2012.11) ) #1 SMP Fri Sep 27 22:55:43 PDT 2013
File data of my app :
ddb: ELF 32-bit LSB executable, ARM, version 1, dynamically linked (uses shared
libs), for GNU/Linux 2.6.33, stripped
File data of a sample hello_world that runs on target :
hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (use
s shared libs), for GNU/Linux 2.6.31, BuildID[sha1]=0x2e8fbebd0bdab5897c0c65fb6b
563f3c34a16eb1, stripped
I can see that different DLL are being used ( 2.6.31 vs 2.6.33 ).
How can I solve this?
I've had that problem before when I tried to copy ARM binaries to an ARM android device.
You solved it, but either way, this is what I found out. The problem was the shared libraries. It is trying to load a library that doesn't exist on the target. The "file not found" error is very misleading.
Related question and answers:
"No such file or directory" but it exists
could be 64<>32bit problem.
See this

Cannot execute binary file error when running bibtex2html

I'm working on a project for a friend on a machine I'm not familiar with and I've run into some errors.
I'm running a program called bibtex2html, which is used to generate an HTML reference page. When I run the program, it gives me a "Cannot execute binary file" error.
From my preliminary research, it seems there are a number of causes to this problem, and I'm not really sure to begin.
What I've done so far:
uname -a ->
Linux baseline 2.6.38-15-generic-pae #60-Ubuntu SMP Tue May 22 11:48:17 UTC 2012 i686 i686 i386 GNU/Linux
file ~/bibtex2html/bibtex2html -> ~/bibtex2html/bibtex2html: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped
You did all the research correctly, now you just need to interpret it. It's a 64-bit executable (x86-64), and you're on a 32-bit kernel (i686). You'll need to find or compile a 32-bit version of bibtex2html.

Resources