Installing Wine 1.9.11 on Ubuntu 16.04

wine-software-that-can-lead-a-man-to-drinkIt should not have been this difficult.

But alas, it has been.

I must have spent 4 or more hours now trying to install Wine 1.9 (though any version would have been just fine after the first few hours), on Ubuntu 16.04 / Xenial.

The reason for all this Wine-ing? SQLYog. It’s by far and away the best MySQL GUI I have ever used, and nothing on Linux comes close. Wine allows me to run Windows software (almost) as though it were a native Linux app. Pretty awesome.

Now, I’ve never had any trouble installing Wine before. I’m almost positive (though it’s always worth doubting my own memory) that I’ve had Wine installed on previous Linux / Ubuntu boxes simply by using the Ubuntu Software Center. Sure, it’s an ancient version, but it does the job.

Things got so desperate that I was in the middle of installing Windows 7 into a VirtualBox VM just so I could run this one single app. And of course, whilst that was installing in the background, I managed to stumble upon a fix.

Anyway, enough background / blather, I’m sure you are only interested in how I fixed this problem.

My Solution

I followed the instruction guide from the Wine docs:

sudo dpkg --add-architecture i386 
sudo add-apt-repository ppa:wine/wine-builds
sudo apt-get update
sudo apt-get install --install-recommends winehq-devel

However this constantly threw up errors like:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies.
 winehq-devel : Depends: wine-devel (= 1.9.11~ubuntu16.04.1)

I knew there was something around the whole x64 / i386 thing going on, and along the way I learned that adding in :i386 after a package name installs the 32 bit version of the software, should you be on a 64 bit OS.

This led me to trying all manner of variations.

Then I stumbled upon this, which gave a much clearer indication of the missing dependency:

➜  ~ sudo apt-get install --install-recommends wine-devel-i386
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies.
 wine-devel-i386:i386 : Depends: libgphoto2-6:i386 (>= 2.5.9) but it is not going to be installed
                        Recommends: libgnutls-deb0-28:i386 but it is not installable or
                                    libgnutls26:i386 but it is not installable
                        Recommends: libsane:i386 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

That led me to this StackOverflow thread which got me much further, but not 100% of the way there.

The first command worked a treat:

sudo apt-get install gcc-multilib libasound2-dev:i386 libgsm1-dev:i386 libjpeg8-dev:i386 liblcms2-dev:i386 libldap2-dev:i386 libmpg123-dev:i386 libopenal-dev:i386 libv4l-dev:i386 libx11-dev:i386 libxinerama-dev:i386 libxml2-dev:i386 zlib1g-dev:i386

But the second one needed a little modification:

sudo apt-get install libcapi20-dev:i386 libcups2:i386 libdbus-1-3:i386 libfontconfig:i386 libfreetype6:i386 libglu1-mesa:i386 libgphoto2-6:i386 libncurses5:i386 libosmesa6:i386 libsane:i386 libxcomposite1:i386 libxcursor1:i386 libxi6:i386 libxrandr2:i386 libxslt1.1:i386 ocl-icd-libopencl1:i386 libgd3:i386

Fortunately, again, the output was very helpful in pointing me towards the right dependency.

With both of those installing all the bits and pieces, finally Wine installed properly:

sudo apt-get install --install-recommends winehq-devel wine-devel

Most of the frustration came from me not understanding the output clearly enough to figure out what dependency I was missing.

Some raw output which may help you debug this problem:

sudo dpkg --add-architecture i386 
sudo add-apt-repository ppa:wine/wine-builds
sudo apt-get update
sudo apt-get install --install-recommends winehq-devel
apt-mark showhold 
sudo apt-get remove wine
sudo apt-get install wine1.7
sudo apt-get install wine1.7-amd64 wine1.7-i386
sudo apt-get install --install-recommends wine-devel
sudo apt-get install --install-recommends wine-devel-i386
sudo apt-get install --install-recommends wine-devel-i386:i386
sudo apt-get install ia32-libs
sudo apt-get install wine-devel-i386
sudo apt-get install --install-recommends winehq-devel wine-devel
sudo apt-get install --install-recommends winehq-devel libasound2-plugins:i386
sudo apt-get install libcapi20-dev:i386 libcups2:i386 libdbus-1-3:i386 libfontconfig:i386 libfreetype6:i386 libglu1-mesa:i386 libgnutls26:i386 libgphoto2-2:i386 libncurses5:i386 libosmesa6:i386 libsane:i386 libxcomposite1:i386 libxcursor1:i386 libxi6:i386 libxrandr2:i386 libxslt1.1:i386 ocl-icd-libopencl1:i386
sudo apt-get install gcc-multilib libasound2-dev:i386 libgsm1-dev:i386 libjpeg8-dev:i386 liblcms2-dev:i386 libldap2-dev:i386 libmpg123-dev:i386 libopenal-dev:i386 libv4l-dev:i386 libx11-dev:i386 libxinerama-dev:i386 libxml2-dev:i386 zlib1g-dev:i386 
apt-get install libcapi20-dev:i386 libcups2:i386 libdbus-1-3:i386 libfontconfig:i386 libfreetype6:i386 libglu1-mesa:i386 libgnutls26:i386 libgphoto2-2:i386 libncurses5:i386 libosmesa6:i386 libsane:i386 libxcomposite1:i386 libxcursor1:i386 libxi6:i386 libxrandr2:i386 libxslt1.1:i386 ocl-icd-libopencl1:i386
sudo apt-get install libcapi20-dev:i386 libcups2:i386 libdbus-1-3:i386 libfontconfig:i386 libfreetype6:i386 libglu1-mesa:i386 libgnutls26:i386 libgphoto2-2:i386 libncurses5:i386 libosmesa6:i386 libsane:i386 libxcomposite1:i386 libxcursor1:i386 libxi6:i386 libxrandr2:i386 libxslt1.1:i386 ocl-icd-libopencl1:i386
sudo apt-get install --install-recommends winehq-devel wine-devel
sudo apt-get install libcapi20-dev:i386 libcups2:i386 libdbus-1-3:i386 libfontconfig:i386 libfreetype6:i386 libglu1-mesa:i386 libgphoto2-2:i386 libncurses5:i386 libosmesa6:i386 libsane:i386 libxcomposite1:i386 libxcursor1:i386 libxi6:i386 libxrandr2:i386 libxslt1.1:i386 ocl-icd-libopencl1:i386
sudo apt-get install libcapi20-dev:i386 libcups2:i386 libdbus-1-3:i386 libfontconfig:i386 libfreetype6:i386 libglu1-mesa:i386  libncurses5:i386 libosmesa6:i386 libsane:i386 libxcomposite1:i386 libxcursor1:i386 libxi6:i386 libxrandr2:i386 libxslt1.1:i386 ocl-icd-libopencl1:i386
sudo apt-get install libcapi20-dev:i386 libcups2:i386 libdbus-1-3:i386 libfontconfig:i386 libfreetype6:i386 libglu1-mesa:i386 libgphoto2-6:i386 libncurses5:i386 libosmesa6:i386 libsane:i386 libxcomposite1:i386 libxcursor1:i386 libxi6:i386 libxrandr2:i386 libxslt1.1:i386 ocl-icd-libopencl1:i386
sudo apt-get install libcapi20-dev:i386 libcups2:i386 libdbus-1-3:i386 libfontconfig:i386 libfreetype6:i386 libglu1-mesa:i386 libgphoto2-6:i386 libncurses5:i386 libosmesa6:i386 libsane:i386 libxcomposite1:i386 libxcursor1:i386 libxi6:i386 libxrandr2:i386 libxslt1.1:i386 ocl-icd-libopencl1:i386 libgd3:1386
sudo apt-get install libcapi20-dev:i386 libcups2:i386 libdbus-1-3:i386 libfontconfig:i386 libfreetype6:i386 libglu1-mesa:i386 libgphoto2-6:i386 libncurses5:i386 libosmesa6:i386 libsane:i386 libxcomposite1:i386 libxcursor1:i386 libxi6:i386 libxrandr2:i386 libxslt1.1:i386 ocl-icd-libopencl1:i386 libgd3:i386
sudo apt-get install --install-recommends winehq-devel wine-devel

wine is not an emulator

But it may make you need a drink.

Published by

Code Review

CodeReviewVideos is a video training site helping software developers learn Symfony faster and easier.

11 thoughts on “Installing Wine 1.9.11 on Ubuntu 16.04”

  1. HI, I am very new to ubuntu and linux. I installed lubuntu on my old pc (completely kick away vista). And I am also desperately trying to install wine 1.9.11 in lubuntu (based on 16.04 64 bits) and failed. I saw your wonderful web site that tells a successful install of wine 1.9.11 in ubutu based lubuntu 16.04.
    I used the 1st and 2nd code in terminal and all went well. But when i used your 3rd code it gave me something i wasn’t able to understand at all hence wondering if i have missed something else.
    Below is the copy of output from the terminal:
    sudo apt-get install gcc-multilib libasound2-dev:i386 libgsm1-dev:i386 libjpeg8-dev:i386 liblcms2-dev:i386 libldap2-dev:i386 libmpg123-dev:i386 libopenal-dev:i386 libv4l-dev:i386 libx11-dev:i386 libxinerama-dev:i386 libxml2-dev:i386 zlib1g-dev:i386
    hope to hear from you.\, thanks.
    Regards,
    William Chan

  2. opps sorry something went wrong in copying from terminal.
    The following should be the ouput after runnign your 3rd code:
    william@william-F3P:~$ sudo apt-get install –install-recommends winehq-devel wine-devel
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Unable to locate package winehq-devel
    E: Unable to locate package wine-devel
    william@william-F3P:~$ wine
    No command ‘wine’ found, did you mean:
    Command ‘win’ from package ‘wily’ (universe)
    Command ‘wing’ from package ‘wing’ (universe)
    Command ‘twine’ from package ‘twine’ (universe)
    Command ‘line’ from package ‘util-linux’ (main)
    Command ‘xine’ from package ‘xine-ui’ (universe)
    Command ‘wipe’ from package ‘wipe’ (universe)
    wine: command not found

    my apology.
    Regards,
    William Chan

  3. Hi Sir,
    I finally get the winehd-devel and wine-devel install and your wine installed success sweetly, thank you so much. You rock sir.
    (I follow the steps in “https://wiki.winehq.org/Ubuntu” first then retry your 3rd code., and went well.)
    I am now able to install .exe file sweetly. thank you again.

    Regards,
    William Chan

    1. Glad you got it sorted out. This was such a pain for me to fix. It has been worth it, even with the occasional Wine crash, but wow, what a lot of effort to get it to work.

  4. i am getting problems regarding the second code and i am unable to install libglu1:i386
    it cannot be installed and keeps on giving errors due to dependencies.
    i d be thankful f u can help

    sudo apt-get install –install-recommends winehq-devel wine-devel
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
    wine-devel : Depends: wine-devel-i386 (= 2.0~rc2~ubuntu16.04.1)
    E: Unable to correct problems, you have held broken packages.

    sudo apt-get install –install-recommends winehq-devel wine-devel wine-devel-i386
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
    wine-devel-i386:i386 : Depends: libglu1-mesa:i386 but it is not going to be installed or
    libglu1:i386
    E: Unable to correct problems, you have held broken packages.

    thank you in advance.

    1. I had no success with playonlinux at the time, and have always stuck with what I know – Wine. But yeah, likely worth a shot for sure. Go with whatever works, which up until this particular issue, Wine always had “just worked” for me.

  5. first blog to fing such a detailed analysis…grateful for that …its been two days for effort but all in vain…when i try the commands , i get the following

    (xenial)sheroze@localhost:~$ sudo apt-get install gcc-multilib libasound2-dev:i386 libgsm1-dev:i386 libjpeg8-dev:i386 liblcms2-dev:i386 libldap2-dev:i386 libmpg123-dev:i386 libopenal-dev:i386 libv4l-dev:i386 libx11-dev:i386 libxinerama-dev:i386 libxml2-dev:i386 zlib1g-dev:i386
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Package gcc-multilib is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package ‘gcc-multilib’ has no installation candidate
    E: Unable to locate package libasound2-dev:i386
    E: Unable to locate package libgsm1-dev:i386
    E: Unable to locate package libjpeg8-dev:i386
    E: Unable to locate package liblcms2-dev:i386
    E: Unable to locate package libldap2-dev:i386
    E: Unable to locate package libmpg123-dev:i386
    E: Unable to locate package libopenal-dev:i386
    E: Unable to locate package libv4l-dev:i386
    E: Unable to locate package libx11-dev:i386
    E: Unable to locate package libxinerama-dev:i386
    E: Unable to locate package libxml2-dev:i386
    E: Unable to locate package zlib1g-dev:i386

    need your guidance ….hate to admit but m quite a noob

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.