I have been trying to install wine on my 64bit Ubuntu 15.10 today and ran into some problems. I installed simply by running
sudo apt-get install wine
Now the issue is that I can't run the wine binary, the error being the following:
linn@Asus:/$ wine
bash: /usr/bin/wine: cannot execute binary file: Exec format error
While the 64 bit binary seems to be working just fine:
linn@Asus:/$ wine64
Usage: wine PROGRAM [ARGUMENTS...] Run the specified program
wine --help Display this help and exit
wine --version Output version information and exit
Now of course I started to digg around a little and it seems that the "wine" binary is indeed a 32 bit binary and I apparently need a couple of extra libraries in order to run those.
linn@Asus:/$ file /usr/bin/wine
/usr/bin/wine: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=ca94516ed13ede12998b464b0a5ef9f5ebebfb67, stripped
Even though I think that any such libraries should come as dependencies when I install wine via apt-get. I still tried to install them but realized that I had all of those already and didn't make a change. (e.g. libraries suggested here or here)
I quite frankly don't know what to try anymore and it doesn't seem like any overly frequent issue, judging by the little amount of similar problems I could find on the web.
One other peculiar issue that might point towards something is that this is a laptop running on Swedish language packages. When I try to run winecfg, the following happens:
linn@Asus:/$ winecfg
/usr/bin/wine: 1: /usr/bin/wine: Syntax error: "(" unexpected
Could there be any messed up paths due to some language issues?
The wine version is the following:
linn@Asus:/$ wine64 --version
wine-1.6.2
But the same issue appeared when trying the 1.7 and 1.8 versions from the official wine PPA.
Thanks for in advance for any help and effort.
Update 1
I have tried to remove any wine related package by running apt-get remove and autoremove on everything I could find that had to do with wine. Checking dpkg for any wine related packages now gave me:
linn@Asus:~$ dpkg --get-selections | grep -e wine
libkwineffects6 deinstall
libwine-development:amd64 deinstall
libwine-development:i386 deinstall
wine1.6 deinstall
wine1.6-amd64 deinstall
wine1.6-i386:i386 deinstall
wine1.8 deinstall
wine1.8-amd64 deinstall
wine1.8-i386:i386 deinstall
Then I tried what Gert Otten suggested in his answer and ran (i tried to install just plain "wine" instead of "wine-bin" because the package "wine-bin" doesn't seem to exist for Ubuntu 15.10):
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install wine
Unfortunately it results in the same issues.
test.c
with the textint main(){}
. Next executegcc test.c -march=i386 -m32 -o a
— that would create filea
. Execute it like./a
, and tell if you see any error (ideally you wouldn't see any output at all).