You are not logged in.

#1 2011-03-11 01:08:00

thewebdoctor
Member
From: North Georgia, North America
Registered: 2011-03-08
Posts: 30
Website

What Causes "No such file..." When There Is A File?

I think I've seen this in the past, but I failed to record the solution. I did a forum search, but didn't turn up anything.

I've seen a couple of programs where, when you're in the folder, and you execute "./programname" Linux says: No such file or directory

And the program files have executable permissions, such as rwx rx rx

Lane

Offline

#2 2011-03-11 01:58:16

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: What Causes "No such file..." When There Is A File?

You mean you're in the folder where that file is located?

[karol@black ~]$ ls -l programname 
-rwxr-xr-x 1 karol users 33 03-11 02:58 programname
[karol@black ~]$ cat programname 
#!/bin/bash
echo This is a test.
[karol@black ~]$ ./programname 
This is a test.

Offline

#3 2011-03-11 02:37:47

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: What Causes "No such file..." When There Is A File?

thewebdoctor wrote:

I think I've seen this in the past, but I failed to record the solution. I did a forum search, but didn't turn up anything.

I've seen a couple of programs where, when you're in the folder, and you execute "./programname" Linux says: No such file or directory

And the program files have executable permissions, such as rwx rx rx

Lane

You're running a 64 bit OS and the binary that you're trying to run is a statically compiled 32 bit binary. You need to install some 32 bit libraries to get things working.

Last edited by skottish (2011-03-11 02:39:14)

Offline

#4 2011-03-11 02:40:26

thewebdoctor
Member
From: North Georgia, North America
Registered: 2011-03-08
Posts: 30
Website

Re: What Causes "No such file..." When There Is A File?

skottish wrote:

You're running a 64 bit OS and the binary that you're trying to run is a statically compiled 32 bit binary.

Yes, that would certainly fit. I thought I would get some other complaint for that. But I'm delighted to know the exact nature of the problem.

And I'm going to record something about it, so hopefully when it happens after I've forgotten it, I'll see the note.

Lane

Offline

#5 2011-03-11 03:02:17

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: What Causes "No such file..." When There Is A File?

man file

Tells you whether that actually is the issue.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#6 2011-03-11 03:29:54

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: What Causes "No such file..." When There Is A File?

thewebdoctor wrote:
skottish wrote:

You're running a 64 bit OS and the binary that you're trying to run is a statically compiled 32 bit binary.

Yes, that would certainly fit. I thought I would get some other complaint for that. But I'm delighted to know the exact nature of the problem.

And I'm going to record something about it, so hopefully when it happens after I've forgotten it, I'll see the note.

Lane

If the program was originally dynamically linked, you'd be seeing 'Wrong ELF class' errors. That makes solving the problem much more simple because error usually points you in the right direction.

The simplest approach to solving this problem is to check the program's site, README file, Arch's AUR, etc, and looking for any dependencies. You won't need much to see it what it wants. For instance, if a site says that you 'only' need the binary and libstdc++5 to run and you're on a 64 bit system, just install lib32-libstdc++5. It may not be enough to make the program work, but the 'Wrong ELF class' errors will appear and point you in the right direction.

Offline

#7 2011-03-13 01:36:23

thewebdoctor
Member
From: North Georgia, North America
Registered: 2011-03-08
Posts: 30
Website

Re: What Causes "No such file..." When There Is A File?

skottish wrote:

For instance, if a site says that you 'only' need the binary and libstdc++5 to run and you're on a 64 bit system, just install lib32-libstdc++5.

One problem I don't know how to solve, other than by asking on here, is the exact name of the package for a particular library.

In Debian-type distros, I can use Synaptic, the GUI package manager, to search for and identify the needed package. OTOH, if I know the package name, I can use apt-get or aptitude, which act like pacman from the terminal.

Is there a way to identify which package contains a particular dependency?

Lane

Offline

#8 2011-03-13 01:40:53

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: What Causes "No such file..." When There Is A File?

thewebdoctor wrote:

Is there a way to identify which package contains a particular dependency?

I'm not sure if this will help, but you can find which package (if any) contains a file you need - use 'pkgfile' command from pkgtools package.

Last edited by karol (2011-03-13 01:44:10)

Offline

#9 2011-03-13 02:03:02

thewebdoctor
Member
From: North Georgia, North America
Registered: 2011-03-08
Posts: 30
Website

Re: What Causes "No such file..." When There Is A File?

karol wrote:

I'm not sure if this will help, but you can find which package (if any) contains a file you need - use 'pkgfile' command from pkgtools package.

Thanks! I'll see how it goes.

Lane

Offline

Board footer

Powered by FluxBB