0

Question: What can I do now to get this 32-bit file to run on my 64 bit ubuntu installation?

Main error: Exec format error. Binary file not executable.

I'm trying to run a file that was compiled over 10 years ago. The configurations of this file are:

ELF 32-bit LSB executable, 
Intel 80386, version 1 (SYSV), 
statically linked, 
for GNU/Linux 2.2.5, stripped

My Ubuntu subsystem configurations are:

x86_64 x86_64 x86_64 GNU/Linux
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:        18.04
Codename:       bionic

Therefore, I've been following this guide to get the 32 bit file to work on my 64 bit ubuntu installation: How to run 32-bit app in Ubuntu 64-bit?.

Essentially, I've performed the following steps:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
sudo apt-get install multiarch-support

Afterwards, I run the following command to run the file:

sudo ./executeFile inputFile

This does not work for me as I'm still receiving a Exec format error. Binary file not executable. error.

I've followed various other guides on AskUbuntu and installed various packages. A similar to the above guide I followed, another example is Running a 32bit executable, with the commands:

sudo apt-get install --reinstall libc6-i386
sudo apt-get install libgl1-mesa-glx:i386 lsb-core

1 Answers1

-1

This answered helped me solve my issue: https://stackoverflow.com/questions/36665669/trying-and-failing-to-run-hello-world-32-bit-c-program-on-64-bit-ubuntu-on-w/36896713#36896713

Main points were using these commands:

sudo apt install qemu-user-static
sudo update-binfmts --install i386 /usr/bin/qemu-i386-static --magic '\x7fELF\x01\x01\x01\x03\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x03\x00\x01\x00\x00\x00' --mask '\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xf8\xff\xff\xff\xff\xff\xff\xff'

sudo service binfmt-support start

sudo dpkg --add-architecture i386 sudo apt update sudo apt install g++:i386