The problem is, that the binary is a 32bit executable and you're running a 64bit Ubuntu. That is not a problem, since Ubuntu offers support for multiple architectures.
If in doubt about the nature of an executable, or any file in general, the command
file <filename>
offers valuable information. If the command is not available, it can be installed through
sudo apt-get install file
In this case, it tells us among other information
ac3d: ELF 32-bit LSB executable[...]
interpreter /lib/ld-linux.so.2
The interpreter is the bit of software responsible for loading all the shared libraries a binary needs to run. If it's missing, an application cannot run.
32- and 64bit executables need different interpreters and different versions of shared libraries. Fortunately Ubuntu (or more precisely Debian) introduced very sophisticated multi-architecture support some time ago[cit. needed]
To make sure the package system is prepared for another architecture, one can view the systems default architecture with
dpkg --print-architecture
On a 64bit Ubuntu this will default to amd64
.
dpkg --print-foreign-architectures
prints out all other architectures the package system is aware of. For 32bit support, the output must contain i386
. If it does not, one can add support with
sudo dpkg --add-architecture i386
It is necessary to update the package list afterwards
sudo apt-get update
The necessary libraries or packages in their i386 flavor can now be installed with
sudo apt-get install <package>:i386
More specifically, to install the needed interpreter, the installation of the GNU C Shared Library
is indicated:
sudo apt-get install libc6:i386
This will in many cases make the binary in question execute, but of course there are many libraries an application can be dynamically linked against, that is depend on. These need to be installed in the same fashion. If a library is missing, the linker will give an error at execution
./ac3d: error while loading shared libraries: libGLU.so.1: \
cannot open shared object file: No such file or directory
At this point one needs to find, which package contains this missing file.
If the corresponding package in the native architecture is already installed, one can search vi adpkg
dpkg -S libGLU.so.1
libglu1-mesa:amd64: /usr/lib/x86_64-linux-gnu/libGLU.so.1
So we would need to install libglu1-mesa:i386
. Repeat until all dependencies are satisfied.
But often a library is completely missing from the system. In that case, one can either search Ubuntu's online package database, or install the utility apt-file
and do
apt-file search <filename>
A very nice HOWTO on multi-arch support on Debian (same holds for Ubuntu) can be found here.
Extra: The package binutils
contains some pretty nifty tools to examine binaries. In particular it contains the ldd
(List Dynamic Dependencies) util. It lists all the dynamic libraries a binary needs to run.
Example:
ldd ac3d
produces
linux-gate.so.1 (0xf77b7000)
libfreetype.so.6 => /usr/lib/i386-linux-gnu/libfreetype.so.6 (0xf76ee000)
libGLU.so.1 => not found
libGL.so.1 => not found
libpng12.so.0 => /lib/i386-linux-gnu/libpng12.so.0 (0xf76c0000)
libXmu.so.6 => not found
libXext.so.6 => not found
libX11.so.6 => not found
libdl.so.2 => /lib/i386-linux-gnu/i686/cmov/libdl.so.2 (0xf76ba000)
libpthread.so.0 => /lib/i386-linux-gnu/i686/cmov/libpthread.so.0 (0xf769e000)
libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xf75ac000)
libm.so.6 => /lib/i386-linux-gnu/i686/cmov/libm.so.6 (0xf7566000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf7549000)
libc.so.6 => /lib/i386-linux-gnu/i686/cmov/libc.so.6 (0xf739e000)
libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xf7381000)
/lib/ld-linux.so.2 (0xf77ba000)
This way one can find out quickly which libraries are missing from the system.
./
and then<tab>
twice to see if it's recognized.ls -l ac3d
, and if the file really existshead -1 ac3d
to your question. Do not put the output in a comment, but please edit your question.dpkg --print-architecture
anddpkg --print-foreign-architectures