Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Executing 32 bit code under Ubundu 64 bit installation error- No such file or directory

Why I am getting "No such file or directory" error when I am running 32 bit executable in a 64 bit Ubundu installation?

What I expect is : A message that "file is invalid", OR the 32 bit code get run correctly.

Details below:

user@user-desktop:~/32_64$ ls
myfile32bit  myfile64bit

user@user-desktop:~/32_64$ file myfile32bit
myfile32bit: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, not stripped

user@user-desktop:~/32_64$ file myfile64bit
myfile64bit: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, not stripped

user@user-desktop:~/32_64$ ls -l
total 1532
-rwxrwxrwx 1 user user  126381 2011-10-11 13:20 myfile32bit
-rwxrwxrwx 1 user user  146785 2011-10-22 12:46 myfile64bit

user@user-desktop:~/32_64$ ./myfile64bit
Hello World

user@user-desktop:~/32_64$ ./myfile32bit
-bash: ./myfile32bit: No such file or directory

user@user-desktop:~/32_64$ uname -a
Linux user-desktop 2.6.32-33-generic #70-Ubuntu SMP Thu Jul 7 21:13:52 UTC 2011 x86_64 GNU/Linux
like image 205
Lunar Mushrooms Avatar asked Jan 06 '12 02:01

Lunar Mushrooms


People also ask

How do I enable 32-bit on 64 bit Ubuntu?

To install 32-bit libraries on Ubuntu 13.04 (64-bit) or later, open Terminal and type: sudo apt-get install lib32z1 (you will need to enter your password). Then just for good measure, let's make sure your Ubuntu is up to date. Type sudo apt-get update and lastly, restart your computer.

How do I fix No such file or directory in Linux?

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. then the problem can be fixed by making sure the mentioned libraries are installed and in the library search path.

Can I run Ubuntu 32-bit on a 64 bit computer?

All 64-bit (x86-64) CPUs should be fast enough to run Ubuntu and can run the 32-bit (x86) version as well.

Does Ubuntu 20.04 support 32-bit applications?

However, with Ubuntu 20.04 there is no support for 32-bit at all. You can read more about the OS and download a Beta image HERE.


1 Answers

There is a great article about this exact problem here:

http://www.markusbe.com/2009/09/about-running-32-bit-programs-on-64-bit-ubuntu-and-shared-libraries/

like image 114
Ken Nickel Avatar answered Sep 20 '22 03:09

Ken Nickel