I have an old program compiled for an ubuntu 16.04 i386, I need to run it or recompile for i386 architecture in my new pc (change 32 to 64 bit is quite complicated in this code". I have an ubuntu 22.04.1 but I dont know how to run 32 bit program on 64 bit ubuntu
Asked
Active
Viewed 794 times
1 Answers
2
First
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libstdc++6:i386
This allow my system to recognize which libraries the program needs. Then, know libs needed.
ldd your_program_name
I needed a lot of Qt libs so I installed.
sudo apt-get install qtbase5-dev:i386 qtmultimedia5-dev:i386
That is all that I needed.

Juan Jose
- 61
bash: ./motor No such file or directory
so I didls -la -rxwxr-xr-x 1 user user 7414460 Feb 14 15:15 motor
– Juan Jose Feb 15 '23 at 13:15ldd ./motor
and see what libraries it's after? – popey Feb 15 '23 at 13:16not a dynamic executable
– Juan Jose Feb 15 '23 at 13:17strace
to see what it's after. If it's something you only need now and then, you could spin up a 32-bit 16.04 VM and run it there, but if you need it regularly, it's likely you're going to need to port to 64-bit or get someone else do to the port. – popey Feb 15 '23 at 13:26No such file or directory
andnot a dynamic executable
likely mean you don't even have a loader for 32-bit executables (ex./lib32/ld-linux.so.2
) on your system - at a minimum, you will need to add the i386 architecture and install the libc6:i386 package I think. Then you will be able to see what other 32-bit dynamic libs are missing. – steeldriver Feb 15 '23 at 13:44sudo dpkg --add-architecture i386 sudo apt-get update sudo apt-get install libc6:i386 libstdc++6:i386
I also installed the following packages from apt
– Juan Jose Feb 15 '23 at 13:56sudo apt-get install qtbase5-dev:i386 qtmultimedia5-dev:i386
Now everything is working perfectly.