Linux run file no such file or directory

Debian: No such file or directory — а файл есть

Здравствуйте, уважаемые. Скачал btsync (у меня arm, по ссылке Linux ARM тут), положил в /usr/bin и не могу запустить:

Как так и что с этим делать?

P.S. Тоже самое происходит, если переместить исполняемый файл, например, в домашний каталог.

P.S.S. Debian Jessie, вот такая железка.

chmod +x точно не поможет?

apparmor, selinux, noexec?

noexec на разделе

такое бывает когда исполняемый файл например предназначенный для 32 битной архитектуры пытаются запустить в 64-битной системе

А что покажет file btsync ? Необязательно на самой железке.

apparmor, selinux, chattr — это что? Что посмотреть?

В общем, похоже-таки несовместимость архитектур. Придётся пересобирать из исходников. Источник: http://otvety.google.ru/otvety/thread?tid=1e74bf1617bdb4b6

Try to run the following command

I had the same issue on Cubieboard.

Try to run the following command:

sudo ln -s /lib/arm-linux-gnueabihf/ld-linux.so.3 /lib/ld-linux.so.3

На Debian 7.6.0 (Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u3 x86_64 GNU/Linux) столкнулся с той же проблемой. Для запуска 32-битного приложения может потребоваться пакет ia32-libs-i386. Дебиан по умолчанию не дает его установить из-за зависимостей. Решается таким образом:

sudo dpkg —add-architecture i386 sudo apt-get update sudo apt-get install ia32-libs-i386 (тянет за собой 60Мб зависимостей)

Источник

Running executable file: No such file or directory [closed]

Want to improve this question? Update the question so it’s on-topic for Unix & Linux Stack Exchange.

Closed 3 years ago .

I am trying to run an executable file called i686-elf-gcc in my Kali Linux that I downloaded from this repository. It’s a cross-compiler. The problem is that even though the terminal and a script that I wrote can both see that the file exists, when its time to actually execute it I get No such file or directory error.Here is an image that explains it:

I have also to say that I have granted the necessary permissions to the executable.

1 Answer 1

Typically, the «unable to execute. No such file or directory» means that either the executable binary itself or one of the libraries it needs does not exist. Libraries can also need other libraries themselves.

To see a list of libraries required by a specified executable or library, you can use the ldd command:

Читайте также:  Исправить проблему зависимостей astra linux

If the resulting listing includes lines like

then the problem can be fixed by making sure the mentioned libraries are installed and in the library search path.

In this case, the libraries might be at /usr/local/lib or /usr/local/lib64 , but for some reason that directory is not included in the library search path.

If you want the extra libraries to be available for specific programs or sessions only, you could use the LD_LIBRARY_PATH environment variable to identify the extra path(s) that should be searched for missing libraries. This will minimize the chance of conflicts with the system default libraries.

Источник

«No such file or directory» but it exists

I simply want to run an executable from the command line, ./arm-mingw32ce-g++ , but then I get the error message,

I’m running Ubuntu Linux 10.10. ls -l lists

Using sudo ( sudo ./arm-mingw32ce-g++ ) gives

I have no idea why the OS can’t even see the file when it’s there. Any thoughts?

14 Answers 14

This error can mean that ./arm-mingw32ce-g++ doesn’t exist (but it does), or that it exists and is a dynamically linked executable recognized by the kernel but whose dynamic loader is not available. You can see what dynamic loader is required by running ldd /arm-mingw32ce-g++ ; anything marked not found is the dynamic loader or a library that you need to install.

If you’re trying to run a 32-bit binary on an amd64 installation:

  • Up to Ubuntu 11.04, install the package ia32-libs .
  • On Ubuntu 11.10, install ia32-libs-multiarch .
  • Starting with 12.04, install ia32-libs-multiarch , or select a reasonable set of :i386 packages in addition to the :amd64 packages.

I faced this error when I was trying to build Selenium source on Ubuntu. The simple shell script with correct shebang was not able to run even after I had all pre-requisites covered.

I opened the file in Vim and I could see that just because I once edited this file on a Windows machine, it was in DOS format. I converted the file to Unix format with below command:

I hope that we should take care whenever we edit files across platforms we should take care for the file formats as well.

Источник

«No such file or directory» error when executing a binary

I was installing a binary Linux application on Ubuntu 9.10 x86_64. The app shipped with an old version of gzip (1.2.4), that was compiled for a much older kernel:

I wasn’t able to execute this program. If I tried, this happened:

ldd was similarly unhappy with this binary:

I’m curious: What’s the most likely source of this problem? A corrupted file? Or a binary incompatibility due to being built for a much older ?

Читайте также:  Возможно dns сервер недоступен что делать windows

Per nos’s suggestsions, here’s the output of strace ./gzip :

Here’s the output of readelf -a ./gzip :

8 Answers 8

The answer is in this line of the output of readelf -a in the original question

I was missing the /lib/ld-linux.so.2 file, which is needed to run 32-bit apps. The Ubuntu package that has this file is libc6-i386.

Old question, but hopefully this’ll help someone else.

In my case I was using a toolchain on Ubuntu 12.04 that was built on Ubuntu 10.04 (requires GCC 4.1 to build). As most of the libraries have moved to multiarch dirs, it couldn’t find ld.so. So, make a symlink for it.

Check required path:

If you’re on 32bit, it’ll be i386-linux-gnu and not x86_64-linux-gnu.

You get this error when you try to run a 32-bit build on your 64-bit Linux.

Also contrast what file had to say on the binary you tried (ie: 32-bit) with what you get for your /bin/gzip :

which is what I get on Ubuntu 9.10 for amd64 aka x86_64.

Edit: Your expanded post shows that as the readelf output also reflects a 32-bit build.

I think you’re x86-64 install does not have the i386 runtime linker. The ENOENT is probably due to the OS looking for something like /lib/ld.so.1 or similar. This is typically part of the 32-bit glibc runtime, and while I’m not directly familiar with Ubuntu, I would assume they have some sort of 32-bit compatibility package to install. Fortunately gzip only depends on the C library, so that’s probably all you’ll need to install.

I also had problems because my program interpreter was /lib/ld-linux.so.2 however it was on an embedded device, so I solved the problem by asking gcc to use ls-uClibc instead as follows:

It is possible that the executable is statically linked and that is why ldd gzip does not see any links — because it isn’t. I don’t know much about things that far back so I don’t know if there would be incompatibilities if libraries are linked in statically. I might expect there to be.

I know it’s the most obvious thing going and I’m sure you’ve done it, but chmod +x ./gzip , yes? No such file or directory is a classic symptom of that not being done, that’s why I mention it.

Well another possible cause of this can be simple line break at end of each line and shebang line If you have been coding in windows IDE its possible that windows has added its own line break at the end of each line and when you try to run it on linux the line break cause problems

Читайте также:  Whatsapp desktop windows 10 что это

Not the answer you’re looking for? Browse other questions tagged linux or ask your own question.

Linked

Hot Network Questions

Subscribe to RSS

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.10.8.40416

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Источник

No such file or directory? But the file exists!

I’ve downloaded a game (Shank) but the bin file doesn’t run. The error that is shown when I try to launch the executable is:

8 Answers 8

You’re probably trying to run a 32-bit binary on a 64-bit system that doesn’t have 32-bit support installed.

There are three cases where you can get the message “No such file or directory”:

  • The file doesn’t exist. I presume you’ve checked that the file does exist (perhaps because the shell completes it).
  • There is a file by that name, but it’s a dangling symbolic link.
  • The file exists, and you can even read it (for example, the command file shank-linux-120720110-1-bin displays something like “ELF 32-bit LSB executable …”), and yet when you try to execute it you’re told that the file doesn’t exist.

The error message in this last case is admittedly confusing. What it’s telling you is that a key component of the runtime environment necessary to run the program is missing. Unfortunately, the channel through which the error is reported only has room for the error code and not for this extra information that it’s really the runtime environment that’s to blame. If you want the technical version of this explanation, read Getting “Not found” message when running a 32-bit binary on a 64-bit system.

The file command will tell you just what this binary is. With a few exceptions, you can only run a binary for the processor architecture that your release of Ubuntu is for. The main exception is that you can run 32-bit (x86, a.k.a. IA32) binaries on 64-bit (amd64, a.k.a. x86_64) systems.

In Ubuntu up to 11.04, to run a 32-bit binary on a 64-bit installation, you need to install the ia32-libs package . You may need to install additional libraries (you’ll get an explicit error message if you do).

Since 11.10 (oneiric) introduced multiarch support, you can still install ia32-libs , but you can choose a finer-grained approach, it’s enough to get libc6-i386 (plus any other necessary library).

Источник

Оцените статью