Unable to install winehq-staging, Ubuntu 16.04 64bit

I have been running wine on Ubuntu 16.04, installed via sudo apt-get install wine, but I would like to switch to wine-staging. I am attempting to follow the instructions at https://wiki.winehq.org/Ubuntu

I first uninstalled wine and made sure all packages were up to date:

sudo apt-get remove wine wine-mono wine-gecko winetricks
sudo apt-get autoremove
sudo apt-get update
sudo apt-get upgrade

I then rebooted and ran the following series of commands:

sudo dpkg --add-architecture i386
wget -nc https://dl.winehq.org/wine-builds/Release.key
sudo apt-key add Release.key
sudo apt-add-repository https://dl.winehq.org/wine-builds/ubuntu/
sudo apt-get update

However, the command to install winehq-staging fails with unmet dependency on wine-staging:

sudo apt-get install --install-recommends winehq-staging

The following packages have unmet dependencies:
 winehq-staging : Depends: wine-staging (= 2.13.0~xenial)
E: Unable to correct problems, you have held broken packages.

Installing wine-staging fails with unmet dependency on wine-staging-i386:

sudo apt-get install wine-staging

The following packages have unmet dependencies:
 wine-staging : Depends: wine-staging-i386 (= 2.13.0~xenial)
E: Unable to correct problems, you have held broken packages.

Installing wine-staging-i386 fails with various unmet dependencies on -i386 packages. Showing a few of them (the list is much longer):

sudo apt-get install wine-staging-i386

The following packages have unmet dependencies:
 wine-staging-i386:i386 : Depends: libasound2:i386 (>= 1.0.16) but it is not installable
                          Depends: libglib2.0-0:i386 (>= 2.12.0) but it is not installable
                          Depends: libgphoto2-6:i386 (>= 2.5.9) but it is not installable
                          Depends: libgphoto2-port12:i386 (>= 2.5.9) but it is not installable

(snip)

                          Recommends: libxslt1.1:i386 (>= 1.1.25) but it is not installable
                          Recommends: libxxf86vm1:i386 but it is not installable
E: Unable to correct problems, you have held broken packages.

If I try to install the first one, it is not available:

sudo apt-get install libasound2:i386

Package libasound2:i386 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
However the following packages replace it:
  libasound2-data

E: Package 'libasound2:i386' has no installation candidate

However, package libasound2-data is already installed and the latest version.

I'm not sure what to try next.


Solution 1:

this is an addition to the answer of Elber CM

before execution of "$ sudo apt-get install --install-recommends winehq-staging" I needed to install the following libraries:

$ sudo apt-get install libasound2-plugins:i386
$ sudo apt-get install wine-staging-i386
$ sudo apt-get install wine-staging

and finally

$ sudo apt-get install --install-recommends winehq-staging

voila, now it works.

Solution 2:

English is not my native language so please be patient.

Apparently the solution is a little more complex, following tutorial on:

https://codereviewvideos.com/blog/wine-1-9-11-on-ubuntu-16-04/

It's necesary to install first some libraries:

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

Then make a update again:

sudo apt-get update

Again some missing libraries:

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

Finally make the installation required:

Stable branch

sudo apt-get install --install-recommends winehq-stable

Development branch

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

Staging branch

sudo apt-get install --install-recommends winehq-staging

PSDT: Some of the librares could be included, that depends of other programs that could use them and Ubuntu version.

Solution 3:

I managed to install wine for Ubuntu 18.04 with next steps:

# basic steps
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/ bionic main'

# fix of the broken dependency
sudo add-apt-repository ppa:cybermax-dexter/sdl2-backport

# install winehq
sudo apt install --install-recommends winehq-staging

Found the solution here.

Solution 4:

Solved the problem by checking all checkboxes in "Software and Updates". After that, I was able to successfully install all dependencies and wine staging via:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install --install-recommends winehq-staging