3

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.

1
  • That's indeed very interesting ____ Ok, do that: create file test.c with the text int main(){}. Next execute gcc test.c -march=i386 -m32 -o a — that would create file a. Execute it like ./a, and tell if you see any error (ideally you wouldn't see any output at all).
    – Hi-Angel
    Jan 16, 2016 at 16:56

2 Answers 2

1

Okay so the problem was that I used a custom 4.4 kernel that I needed because the touchpad on my laptop wasn't working. The issue is described in this kernel bugzilla thread.

The required changes were included in the 4.5 version of the Linux Kernel which I am running now. The moment I changed from the custom kernel to the mainline kernel, wine started to work without a problem. I then also tested with an official 4.4 mainline kernel and wine worked with that one as well. So I am pretty certain that the custom kernel was the cause of the issue, although I can't really explain how.

Hope this might help someone with similar issues.

1
  • I had the same problem with a custom kernel. The problem was solved by enabling the following two features in ´make menuconfig´: Executable file formats / Emulation -> * IA32 Emulation * x32 ABI for 64-bit mode. I am not sure if both is necessary.
    – Jan
    Jun 9, 2016 at 10:41
0

You have to install the i386 version of Wine, you can do so using these commands:

sudo dpkg --add-architecture i386

After that run:

sudo apt-get update && sudo apt-get install wine-bin

And lastly run:

winecfg

To test the Wine i386 version.

1
  • I tried that. Adding the architecture and the following update work fine. However, apt-get can't find any wine-bin package afterwards. Edit: Apparently it is available for 14.04 (launchpad.net/ubuntu/trusty/+package/wine-bin), but it doesn't seem to work on 15.10 .
    – hopfi
    Jan 15, 2016 at 9:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .