Solution for unmet dependencies or broken packages while installing Wine32 on Ubuntu Eoan 19.10




I’ve faced this problem several times, where it is not possible to install 32 bit Wine on Ubuntu (and possibly Debian). In each case, the problem has been packages installed from Ondrej Sury’s repository (for installing php7 in my case). It may be a different repository in your case, but the reason could be the same – it did not install 32 bit packages.

How to know if this is the problem you are facing as well.

Try to install 32 bit Wine. It is better to use the official repository, so:

sudo dpkg --add-architecture i386
wget -nc https://dl.winehq.org/wine-builds/winehq.key
sudo apt-key add winehq.key
sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ eoan main'
sudo apt update
sudo apt install --install-recommends winehq-staging

Or you can simply add from the available repositories. Which one is not the issue, but if the packages are broken, you will not be able to install 32 bit Wine using any of the methods. It isn’t helpful that usual methods to fix it like “apt install -f” don’t show broken packages. The packages aren’t broken unless you need to install the equivalent i386 versions.

Then this happens.

$sudo # apt install wine32
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:
 wine32:i386 : Depends: libwine:i386 (= 4.0.2-1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Oops!

If you try to install the unmet dependencies by adding them to the install line (don’t reply “Y” to any of the installs, just dig into the dependencies) you get:

$ sudo apt -f install wine32 libwine: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:
 libwine:i386 : Depends: libglib2.0-0:i386 (>= 2.12.0) but it is not going to be installed
                Depends: libgphoto2-6:i386 (>= 2.5.10) but it is not going to be installed
                Depends: libgstreamer-plugins-base1.0-0:i386 (>= 1.0.0) but it is not going to be installed
                Depends: libgstreamer1.0-0:i386 (>= 1.4.0) but it is not going to be installed
                Depends: libldap-2.4-2:i386 (>= 2.4.7) but it is not going to be installed
                Depends: libxml2:i386 (>= 2.9.0) but it is not going to be installed
                Recommends: libcups2:i386 (>= 1.4.0) but it is not going to be installed
                Recommends: libgnutls30:i386 (>= 3.6.5) but it is not going to be installed
                Recommends: libgssapi-krb5-2:i386 (>= 1.6.dfsg.2) but it is not going to be installed
                Recommends: libkrb5-3:i386 (>= 1.6.dfsg.2) but it is not going to be installed
                Recommends: libxslt1.1:i386 (>= 1.1.25) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Keep adding the packages to the install (I’ll spare you the boring details) to discover more dependencies. And so on, till you get lines about broken packages like so:

 libpcre2-8-0 : Breaks: libpcre2-8-0:i386 (!= 10.34-7+ubuntu19.10.1+deb.sury.org+1) but 10.32-5 is to be installed
 libpcre2-8-0:i386 : Breaks: libpcre2-8-0 (!= 10.32-5) but 10.34-7+ubuntu19.10.1+deb.sury.org+1 is to be installed
 libpcre3 : Breaks: libpcre3:i386 (!= 2:8.43-1+ubuntu19.10.1+deb.sury.org+1) but 2:8.39-12 is to be installed
 libpcre3:i386 : Breaks: libpcre3 (!= 2:8.39-12) but 2:8.43-1+ubuntu19.10.1+deb.sury.org+1 is to be installed

This gives you a hint of the problem. The packages with deb.sury.org are the ones from Ondrej Sury’s repository. I had forgotten I had installed them, some upgrade since had removed the ppa as well. But they were the culprit. I suppose you could add the ppa again (your repository may differ).

$ sudo add-apt-repository ppa:ondrej/php

It is best you do this regardless of whether you plan to use the repository or downgrade the packages to the default ones in Ubuntu repositories. I didn’t need the repository anymore, so I downgraded the packages. There are many methods, but my idiot-proof preference is the ppa-purge package. It downgrades the packages without me needing to know too much about the process.

$ sudo apt install ppa-purge
$ sudo  ppa-purge  ppa:ondrej/php

Now, if you try to install wine32, it should work.

Note: I am at best a copy-paste hacker with some aptitude for extrapolating hacks to new situations. This is not a recommendation of best practices or anything. This blog mostly covers problems I face and their fixes, so that the next time I face them, I can refer to what made sense to me before and get things working faster.

Note1: But this did work for me.




Leave a Reply

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