[SOLVED] Debian unable to execute binary files

If none of the more specific forums is the right place to ask

[SOLVED] Debian unable to execute binary files

Postby VentGrey » 2017-10-21 16:29

This is an issue I've been dealing with for 3 months now and I have found no solution, I had my Debian stretch install for 4 months but I don't know if it was after an update or so that Debian is doing very weird things, first of all wine32 & playonlinux don't work at all like steam, (idk what the i386 packaging team is doing that is messing up everything).

But now the problem seems a little odd, at first I thought I broke the system but now I think it is a direct problem from Debian, I liked some lutris games but I didn't want to add the repo so I downloaded the source packages for the games, I tried redeclipse, simutrains and other games but when I tried to execute them I always got the "no such file or directory" error, I downloaded the game am2r and the same problem exists, to prove my point i've taken some screenshots:

https://pasteboard.co/GPZ6395.png

and trying to execute it manually (directly from dir)
https://pasteboard.co/GPZ6pZr.png

If a few more details are needed, yes, the files DO have the correct permissions, in one occasion I did the chmod 777 & the chown things, but they did not work, I'm using Debian 9.2 but right now I havent found any log errors or so, Is my 5th install this week broken? or is Debian having some "internal" problems?

Edit:
Solution: Run the
Code: Select all
file <filename>
command where you have your program & check for the architecture, in this case the output was:
Code: Select all
am2r: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.24, BuildID[sha1]=18ff50b7dc4a1abd6653dda0dd5f720e91ad7593, stripped
If the executable does not come with a dependencies text file you can run the
Code: Select all
objdump -x <file_name>
and search for the "NEEDED" section to see on what libraries does your program depend :mrgreen:
Last edited by VentGrey on 2017-10-23 13:59, edited 1 time in total.
“I felt myself on the edge of the world; peering over the rim into a fathomless chaos of eternal night.”
― H.P. Lovecraft after trying Debian SidImage
User avatar
VentGrey
 
Posts: 156
Joined: 2016-04-26 23:57
Location: Guanajuato México

Re: Debian unable to execute binary files

Postby roseway » 2017-10-21 16:38

This isn't a Debian problem, it's a user problem. If you try and launch a program from the command line, it will only work if the executable is in your PATH. Otherwise you have to type the complete path to the executable. If you want to launch it from the directory where the executable is, you have to put './' in front of the executable name, e.g.:
Code: Select all
./myprogram


If you build the program from source, you need to make sure that the executable is marked as executable. Using chmod 777.. doesn't help. What you need to do is
Code: Select all
chmod +x <path to executable>
Eric
User avatar
roseway
 
Posts: 1479
Joined: 2007-12-31 22:50
Location: Kent, UK

Re: Debian unable to execute binary files

Postby VentGrey » 2017-10-21 16:43

Check the second image, it's what I did, about the chmod +x command, it didn't work. :( problem is still there.
“I felt myself on the edge of the world; peering over the rim into a fathomless chaos of eternal night.”
― H.P. Lovecraft after trying Debian SidImage
User avatar
VentGrey
 
Posts: 156
Joined: 2016-04-26 23:57
Location: Guanajuato México

Re: Debian unable to execute binary files

Postby stevepusser » 2017-10-21 19:22

Please copy and paste your commands and outbox in a code box here instead of just providing links to bulky screenshots. You can also get them to come out in English (with this one simple trick! Learn how!)

I also see a big fat README file in that directory (one thing a screenshot's good for). What's in there?

You should also have some tools installed by default which can provide information about any file, such as "file".

Code: Select all
file <filename>
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Krita 3.3.2.1, Pale Moon 27.6.0, Audacity 2.2.0, mpv 0.27.0, Corebird 1.7.1, Firefox 57.0, SMPlayer 17.11.2
User avatar
stevepusser
 
Posts: 8903
Joined: 2009-10-06 05:53

Re: Debian unable to execute binary files

Postby wizard10000 » 2017-10-21 19:44

VentGrey wrote:Check the second image, it's what I did, about the chmod +x command, it didn't work. :( problem is still there.


Does the file actually exist in the directory? I see from second screenshot that you're in a directory that has the same name as its parent.
we see things not as they are, but as we are.
-- anais nin
User avatar
wizard10000
 
Posts: 1204
Joined: 2011-05-09 20:02
Location: everywhere i go, there i am!

Re: Debian unable to execute binary files

Postby GarryRicketson » 2017-10-21 20:18

If the OP is trying to run this game/program using wine,?
-- first of all wine32 & playonlinux don't work at all like steam,

This will not work,
Code: Select all
./myprogram

There is some info about "wine" on Debian, :
https://wiki.debian.org/Wine
Also I see this :
https://askubuntu.com/questions/86529/how-do-i-start-a-wine-program-from-the-command-line
All though it is Ubuntu, it confirmed my thoughts ( I do not use wine,and was not sure)
From the ubuntu link:
You just have to
Code: Select all
wine /path/to/your/exe/program.exe



For example, for me, the same applies to programs , or games I run in DosBox,...
Code: Select all
$ pacman.EXE
ksh: pacman.EXE: cannot execute - Permission denied
$ ./pacman.EXE
ksh: ./pacman.EXE: cannot execute - Permission denied


Oh no, my pacman game does not work, What do I do ?

Code: Select all
$ pwd
/home/garry/pacman
$ ls -g pacman.EXE
-rw-r--r--  1 garry  220648 Jan  3  1997 pacman.EXE
 

Here I use pwd, to make sure I am in the correct dir.
'ls -g' to see the permissions , it is not +x and does not need to be.
Code: Select all
$ dosbox pacman.EXE
DOSBox version 0.74
Copyright 2002-2010 DOSBox Team, published under GNU GPL.
---
CONFIG:Loading primary settings from config file /home/garry/.dosbox/dosbox-0.74.conf
MIXER:Got different values from SDL: freq 44100, blocksize 882
MIDI:Opened device:sndio
$

I start it with :
Code: Select all
 dosbox pacman.EXE

and it loads and starts the game, in DosBox,.

To start it from my home dir:
Code: Select all
$ dosbox /home/garry/pacman/pacman.EXE
DOSBox version 0.74
Copyright 2002-2010 DOSBox Team, published under GNU GPL.
---snip--

It starts just fine,...
Note: Since your game is 'am2r' use the name exactly like it is,.. IE:
Code: Select all
wine /path/to/your/gamefolder/am2r

And see if it starts.
"What we expect you have already Done"

Before doing anything, read the Debian documentation:
Debian Documentation
How to ask the smart way
Debian Foro Español
======================
For the Birds
User avatar
GarryRicketson
 
Posts: 4356
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Debian unable to execute binary files

Postby Head_on_a_Stick » 2017-10-21 20:32

"Only the mediocre are always at their best." — Jean Giraudoux
User avatar
Head_on_a_Stick
 
Posts: 6672
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Debian unable to execute binary files

Postby VentGrey » 2017-10-21 21:24

@stevepusser
I also see a big fat README file in that directory (one thing a screenshot's good for). What's in there?
It has some windows instructions tho, that is the linux version, the dependencies text also mention it
Code: Select all
32 bit dependencies on Ubuntu/Debian based systems are:
libgcc1:i386 libgl1-mesa-glx:i386 libglu1-mesa:i386 libopenal1:i386 libssl1.0.0:i386
libstdc++6:i386 libx11-6:i386 libxext6:i386 libxrandr2:i386 libxxf86vm1:i386 zlib1g:i386

On a 32 bit distribution you may only need the following as the rest should/will
be installed by default anyway: libglu1-mesa libopenal1 libssl1.0.0 libxxf86vm1


I do have some of those libs installed (except the libssl1.0.0) but what's weird it's that it worked perfectly in previous stretch installs, I can bet anything to it.


@Wizard10000
Does the file actually exist in the directory? I see from second screenshot that you're in a directory that has the same name as its parent.
The file does exist, I even renamed the folder "just in case" but no sucess in doing so.

@GarryRicketson
If the OP is trying to run this game/program using wine,?
No, the game is a Linux native, Wine problem was what made me notice this error :mrgreen:

@Head_on_a_Stick
I DO have enabled my i386 architecture in dpkg, about the ubuntu forum post I think the
ia32-libs
they mention are these
Code: Select all
 libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386
I'm going to try your advice because as Steve said up there the
Code: Select all
file
command did throw a 32 bit binary there :mrgreen:
“I felt myself on the edge of the world; peering over the rim into a fathomless chaos of eternal night.”
― H.P. Lovecraft after trying Debian SidImage
User avatar
VentGrey
 
Posts: 156
Joined: 2016-04-26 23:57
Location: Guanajuato México

Re: Debian unable to execute binary files

Postby GarryRicketson » 2017-10-21 22:52

@GarryRicketson

If the OP is trying to run this game/program using wine,?

No, the game is a Linux native, Wine problem was what made me notice this error :mrgreen:


Oops, sorry, everything I found in my searches indicated this is a game that needs to be run on windows, or with wine, and what you say here:
Post by VentGrey » 2017-10-21 10:29
This is an issue I've been dealing with for 3 months now and I have found no solution, I had my Debian stretch install for 4 months but I don't know if it was after an update or so that Debian is doing very weird things, first of all wine32 & playonlinux don't work at all like steam, (idk what the i386 packaging team is doing that is messing up everything).

Made me think "Wine" is involved.
Could you show us where you got this linux version, ? Is it open source ?
I have to run, have chores to do, and don't have time to explain, but you mention:
I didn't want to add the repo so I downloaded the source packages for the games, I tried redeclipse, simutrains and other games but when I tried to execute them I always got the "no such file or directory" error, I downloaded the game am2r and the same problem exists,

Was it working on your previous Debian version, ? My guess is you need to compile it again, but for the newer Debian version,...there just are not enough details to say much. In a nut shell, I had a similar thing happen, years ago with some games I wrote myself, and compiled on "knoppix", later when I started using Linux mint, they did not work, I had to re-compile for linux mint, the same, when I switched to Ubuntu, and the same when I switched to Debian,... And before I re-compiled them, I would get "file not found", even though the executable was there.
I noticed in one search result, someone has produced this game or a clone,
using "game maker", which is a game engine of sorts, but for windows, and they claim they got it working on Ubuntu, but after all said and done, if this game was made using something like "game maker", you may have a lot of problems getting it to work on Debian, and more so on Stretch then some of the older versions.
I do have some of those libs installed (except the libssl1.0.0) but what's weird it's that it worked perfectly in previous stretch installs, I can bet anything to it.

"Some of" is not all of them, and even 1 little library file missing can cause all sorts of problems, including a "file not found" error.
User avatar
GarryRicketson
 
Posts: 4356
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Debian unable to execute binary files

Postby stevepusser » 2017-10-22 01:38

You can also run
Code: Select all
objdump -x <file_name>


to see what libraries and minimum versions thereof are required.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Krita 3.3.2.1, Pale Moon 27.6.0, Audacity 2.2.0, mpv 0.27.0, Corebird 1.7.1, Firefox 57.0, SMPlayer 17.11.2
User avatar
stevepusser
 
Posts: 8903
Joined: 2009-10-06 05:53

Re: Debian unable to execute binary files

Postby debiman » 2017-10-22 06:36

looking at op's previous threads, i do suspect some sort of architecture mismatch problems.

ventgrey, you need to show us terminal output.
"ls -al" instead of a screenshot, the "file" and "objdump" commands mentioned etc.
User avatar
debiman
 
Posts: 1528
Joined: 2013-03-12 07:18

Re: Debian unable to execute binary files

Postby VentGrey » 2017-10-23 13:54

ventgrey, you need to show us terminal output.
"ls -al" instead of a screenshot, the "file" and "objdump" commands mentioned etc.


Code: Select all
Vent@Debian:~/Escritorio/am2r-1.1-linux$ ls -al
total 3592
drwxrwxr-x 4 vent vent    4096 sep  9  2016 .
drwxr-xr-x 3 vent vent    4096 oct 23 09:08 ..
-rwxrwxr-x 1 vent vent 3650228 nov 22  2014 am2r
drwxr-xr-x 3 vent vent    4096 ago 16  2016 assets
-rw-rw-r-- 1 vent vent     564 ago 14  2016 dependencies.txt
drwxrwxr-x 2 vent vent    4096 oct 23 09:08 icons
-rw-rw-r-- 1 vent vent    2679 ago 16  2016 README


You can also run
Code: Select all
objdump -x <file_name>


Code: Select all
  NEEDED               libstdc++.so.6
  NEEDED               libz.so.1
  NEEDED               libXxf86vm.so.1
  NEEDED               libGL.so.1
  NEEDED               libopenal.so.1
  NEEDED               libm.so.6
  NEEDED               librt.so.1
  NEEDED               libXext.so.6
  NEEDED               libX11.so.6
  NEEDED               libXrandr.so.2
  NEEDED               libGLU.so.1
  NEEDED               libssl.so.1.0.0
  NEEDED               libgcc_s.so.1
  NEEDED               libc.so.6
  NEEDED               libpthread.so.0
  NEEDED               libdl.so.2
  NEEDED               libcrypto.so.1.0.0

Aha! now I assume I need the "i386" versions of those required libs, everything fine but I'm stuck here
Code: Select all
 libssl.so.1.0.0: cannot open shared object file: No such file or directory
, as far as I know Debian uses version 1.0.2 & 1.1, I've googled a bit and found a tip that said:
Make a symlink to your libssl version (and hope everything works), or install the specific libssl version. You have to make sure that only AM2R uses it, because this can make your system insecure / break applications. You can use "ldd ./am2r" to find out which libraries AM2R wants to use. If you set up libssl.so.1.0.0 correctly, ldd should show the path to this libssl library.

should the symlink be in the game folder & be pointing to the i386 version of libssl1.0.2? (Maybe that's for another thread)

As for the problem about the "unreadable" files it has been fixed with the previous advices from @Head_on_a_Stick & @stevepusser, what seems weird to me is that now I need to install these manually when they worked out of the box before, my theory is that some 32-bit libs are being worked on and somehow do not install but, nothing that cannot be fixed by hand, Thanks to everyone who commented on this issue :mrgreen:
“I felt myself on the edge of the world; peering over the rim into a fathomless chaos of eternal night.”
― H.P. Lovecraft after trying Debian SidImage
User avatar
VentGrey
 
Posts: 156
Joined: 2016-04-26 23:57
Location: Guanajuato México


Return to General Questions

Who is online

Users browsing this forum: No registered users and 6 guests

fashionable