Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Command not found? How can this be?

61 views
Skip to first unread message

bovin...@gmail.com

unread,
Nov 5, 2012, 10:45:39 AM11/5/12
to
I have an excutable delivered to my company. Call it dosomething.

I run

./dosomething

and I get

./dosomething: command not found

bizarre..... I tried this on two x86_64 machines, and then decided to run it on my netbook running i686 knoppix running from a usb stick.

It turns out that the executable is 32bit and can't run on 64 bit. But why? How can I fix this? Is it missing some library or something?

Richard Kettlewell

unread,
Nov 5, 2012, 11:10:06 AM11/5/12
to
You don’t say which Linux distribution you’re using but it may have
32-bit compatibility packages which you can install. (The specific
missing thing that provokes that error message will be the 32-bit
version of the runtime linker.)

--
http://www.greenend.org.uk/rjk/

Stefan Patric

unread,
Nov 5, 2012, 11:24:03 AM11/5/12
to
On Mon, 05 Nov 2012 07:45:39 -0800, bovinebear wrote:

> I have an excutable delivered to my company. Call it dosomething.
>
> I run
>
> ./dosomething
>
> and I get
>
> ./dosomething: command not found

./ means to look in the terminal's current directory for dosomething.
Obviously, dosomething is not there. That's why it wasn't found.
Instead use the full path to dosomething where ever that is.

> bizarre..... I tried this on two x86_64 machines, and then decided to
> run it on my netbook running i686 knoppix running from a usb stick.

Did it work? Obviously not. Did you give the full path to the
executable on the usb stick in the command line? Probably not.

> It turns out that the executable is 32bit and can't run on 64 bit. But
> why? How can I fix this? Is it missing some library or something?

To run 32-bit executables on a 64-bit machine you'll need a 64-bit CPU
that has a 32-bit emulation mode, AND the 32-bit libraries the executable
requires. The executable also has to be compatible with your OS. That
is, if it's a Windows' executable, it's not going to run on Linux.

Stef

unruh

unread,
Nov 5, 2012, 12:15:51 PM11/5/12
to
The error message says "not found". Ie, either the command dosomithing
is not in the directory ., (do ls ./dosomething) or its permission is
wrong (chmod a+x ./dosomething).
If it were a library problem or a 32 bit problem the error message would be different.


Richard Kettlewell

unread,
Nov 5, 2012, 12:26:11 PM11/5/12
to
unruh <un...@invalid.ca> writes:
> The error message says "not found". Ie, either the command dosomithing
> is not in the directory ., (do ls ./dosomething) or its permission is
> wrong (chmod a+x ./dosomething).
>
> If it were a library problem or a 32 bit problem the error message
> would be different.

Would it have hurt to check before posting misinformation?

$ ls -l t
-rwxrwxr-x 1 rjk rjk 4363 Nov 5 17:21 t
$ file t
t: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically
linked (uses shared libs), for GNU/Linux 2.6.18, not stripped
$ ./t
-bash: ./t: No such file or directory
$ ls -l u
ls: cannot access u: No such file or directory
$ ./u
-bash: ./u: No such file or directory

Permission problems are different again.

--
http://www.greenend.org.uk/rjk/

James Moe

unread,
Nov 5, 2012, 1:05:48 PM11/5/12
to
On 11/05/2012 08:45 AM, bovin...@gmail.com wrote:
> I have an excutable delivered to my company. Call it dosomething.
>
> I run
> ./dosomething
>
> and I get
> ./dosomething: command not found
>
How did you install the application?

--
James Moe
jmm-list at sohnen-moe dot com

philo

unread,
Nov 5, 2012, 1:18:05 PM11/5/12
to
Look at it's properties first to be sure it's executable...
the attribute may have been lost if it was on an NTFS file system
previously.

Then of course you may need to specify the correct path...
try running it from the folder that it's in you may need to omit the
leading "./"

--
https://www.createspace.com/3707686

John Hasler

unread,
Nov 5, 2012, 2:55:11 PM11/5/12
to
philo writes:
> Then of course you may need to specify the correct path... try
> running it from the folder that it's in you may need to omit the
> leading "./"

If it is not in a directory in his PATH he must specify the complete
path. "./" expands to the current path. Thus if his CWD is the
directory the file is in "./filename" expands to the complete pathname.
--
John Hasler
jha...@newsguy.com
Dancing Horse Hill
Elmwood, WI USA

Grant Edwards

unread,
Nov 5, 2012, 4:01:29 PM11/5/12
to
On 2012-11-05, John Hasler <jha...@newsguy.com> wrote:
> philo writes:
>> Then of course you may need to specify the correct path... try
>> running it from the folder that it's in you may need to omit the
>> leading "./"
>
> If it is not in a directory in his PATH he must specify the complete
> path.

No, a relative path starting with '.' is also sufficient.

> "./" expands to the current path. Thus if his CWD is the
> directory the file is in "./filename" expands to the complete
> pathname.

"./" does not expand to the current path. It simply refers to a
directory named '.' using a path relative to the current working
directory.

$ cat foo
#!/bin/bash
echo $0

$ ./foo
./foo

If you want something to expand to the current path, use $PWD:

$ $PWD/foo
/home/grante/foo

--
Grant Edwards grant.b.edwards Yow! ... I want to perform
at cranial activities with
gmail.com Tuesday Weld!!

root

unread,
Nov 5, 2012, 5:05:25 PM11/5/12
to
dosomething may be calling another program that isn't
there.

The Natural Philosopher

unread,
Nov 5, 2012, 7:14:10 PM11/5/12
to
Probably

e.g Ubuntu and other debian-ish distros will need something like

"One package for 32-bit shared library support on a 64-bit system is
named ia32-libs, which included lots of 32-bit versions of shared
libraries."

So try installing that lot and it should maybe work.

Note that not ALL 32 bit libraries are in that general package: to get a
32 bit app running properly you generally need to check the errors
coming out from the loader and see what else seems to be missing.



--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.

GangGreene

unread,
Nov 5, 2012, 8:00:24 PM11/5/12
to
On Tue, 06 Nov 2012 00:14:10 +0000, The Natural Philosopher wrote:

> On 05/11/12 15:45, bovin...@gmail.com wrote:
>> I have an excutable delivered to my company. Call it dosomething.
>>
>> I run
>>
>> ./dosomething
>>
>> and I get
>>
>> ./dosomething: command not found
>>
>> bizarre..... I tried this on two x86_64 machines, and then decided to
>> run it on my netbook running i686 knoppix running from a usb stick.
>>
>> It turns out that the executable is 32bit and can't run on 64 bit. But
>> why? How can I fix this? Is it missing some library or something?
>>
> Probably
>
> e.g Ubuntu and other debian-ish distros will need something like
>
> "One package for 32-bit shared library support on a 64-bit system is
> named ia32-libs, which included lots of 32-bit versions of shared
> libraries."
>
> So try installing that lot and it should maybe work.
>
> Note that not ALL 32 bit libraries are in that general package: to get a
> 32 bit app running properly you generally need to check the errors
> coming out from the loader and see what else seems to be missing.


Negative. That advice is just pissing in the fan to see if you get wet.

It is better to run ldd, objdump or readelf on dosomething if it is an
elf executable to find out what it is linked to. It could also be an
executable that is linked incorrectly.

The Natural Philosopher

unread,
Nov 5, 2012, 8:28:27 PM11/5/12
to
On 06/11/12 01:00, GangGreene wrote:
> On Tue, 06 Nov 2012 00:14:10 +0000, The Natural Philosopher wrote:
>
>> On 05/11/12 15:45, bovin...@gmail.com wrote:
>>> I have an excutable delivered to my company. Call it dosomething.
>>>
>>> I run
>>>
>>> ./dosomething
>>>
>>> and I get
>>>
>>> ./dosomething: command not found
>>>
>>> bizarre..... I tried this on two x86_64 machines, and then decided to
>>> run it on my netbook running i686 knoppix running from a usb stick.
>>>
>>> It turns out that the executable is 32bit and can't run on 64 bit. But
>>> why? How can I fix this? Is it missing some library or something?
>>>
>> Probably
>>
>> e.g Ubuntu and other debian-ish distros will need something like
>>
>> "One package for 32-bit shared library support on a 64-bit system is
>> named ia32-libs, which included lots of 32-bit versions of shared
>> libraries."
>>
>> So try installing that lot and it should maybe work.
>>
>> Note that not ALL 32 bit libraries are in that general package: to get a
>> 32 bit app running properly you generally need to check the errors
>> coming out from the loader and see what else seems to be missing.
>
>
> Negative. That advice is just pissing in the fan to see if you get wet.
>
Well no, asshole. It worked for me.

> It is better to run ldd, objdump or readelf on dosomething

The application loader will do that anyway.

if it is an
> elf executable to find out what it is linked to. It could also be an
> executable that is linked incorrectly.
>
It works on his 32 bit setup. Ergo its correctly linked

GangGreene

unread,
Nov 5, 2012, 8:56:21 PM11/5/12
to
Of course for some one that doesn't know any better. Why use the proper
tools when a 20lb sledge hammer will work on that tack. Never mind the
collateral damage.

>
>> It is better to run ldd, objdump or readelf on dosomething
>
> The application loader will do that anyway.

Not so, the linker called ld will. It is responsible for the loading the
shared libraries. I thought you would know but I see you do not. I am
not surprised given your solution.

>
> if it is an
>> elf executable to find out what it is linked to. It could also be an
>> executable that is linked incorrectly.
>>
> It works on his 32 bit setup. Ergo its correctly linked

Ok smart ass is he using rpath and has those paths been "linked into" the
executable? What are the non standard libraries linked into this
executable if any? Oh I see you don't have a clue, now shut up and
run ldd, readelf or objdump. Then one knows how to correct this problem.


If it was me I would compile and link under x86_64, but I don't suppose
that would work would it. If I needed a single executable, you could
also statically link it.

The Natural Philosopher

unread,
Nov 6, 2012, 3:41:57 AM11/6/12
to
Because for someone who isn't interested in learning the subtleties of
the linux package dependency and library loading systems, that is the
least number of keystrokes to solve the problem.

You obviously never worked in customer support.

GangGreene

unread,
Nov 6, 2012, 8:45:37 AM11/6/12
to
I see working in customer support makes it right.

The Natural Philosopher

unread,
Nov 6, 2012, 2:51:09 PM11/6/12
to
The only right in customer support is solving the customer problem to
HIS satisfaction with the minimum of effort on YOUR part.

And if that means firing pedantic arseholes, that gets done as well.

GangGreene

unread,
Nov 6, 2012, 4:00:05 PM11/6/12
to
And keeping the ignorant.

Now I see that is why things in the world are such a disaster, minimum or
no effort and don't care if things are correct.

Sorry I don't subscribe to your rules.

Sven Klages

unread,
Nov 8, 2012, 4:26:39 AM11/8/12
to
This may happen if this program has been compiled on different OS
where the linux loader is in another location.

check for the loader, as an example /bin/bash on Ubuntu 12.10:

$ ldd /bin/bash
linux-vdso.so.1 => (0x00007fffcdfff000)
libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007ff635696000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff635492000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff6350d2000)
/lib64/ld-linux-x86-64.so.2 (0x00007ff6358e1000)

If the loader is not found (/lib64/ld-linux-x86-64.so.2) then just
search for it and start the binary with the loader.

E.g. if the loader is for whatever reason found in /usr/lib64/ then just
run /usr/lib64/ld-linux-x86-64.so.2 ./dosomething

Or compile the binary on your own system ..

What different linux systems have you tried?

hth,
Sven

bovin...@gmail.com

unread,
Nov 13, 2012, 4:13:03 PM11/13/12
to

Sorry I was not clear in my original message and threw off a lot of people but a few understood me. The program works with:

./dosomething ....... on a knoppix 32bit netbook

BUT

./dosomething ....... does not work on a two 64 bit setups of the Redhat flavor....

objdump gives "elf32-i386"

it is not a chmod or file-not-there-in-the-directory-problem.....

Richard Kettlewell

unread,
Nov 13, 2012, 5:05:05 PM11/13/12
to
bovin...@gmail.com writes:
> Sorry I was not clear in my original message and threw off a lot of
> people but a few understood me. The program works with:
>
> ./dosomething ....... on a knoppix 32bit netbook
>
> BUT
>
> ./dosomething ....... does not work on a two 64 bit setups of the Redhat flavor....
>
> objdump gives "elf32-i386"
>
> it is not a chmod or file-not-there-in-the-directory-problem.....

The answer remains as before; install 32-bit compatibility packages.

--
http://www.greenend.org.uk/rjk/

bovinebear

unread,
Nov 14, 2012, 8:56:58 AM11/14/12
to
thanks buddy it worked!
0 new messages