Can't install wine from winehq.org on Ubuntu (actually Lubuntu) 18.04 LTS

Analysis

The WineHQ repository misses the dependencies for wine-stable package.
I have reported a bug 48513 to WineHQ bugzilla.

The main problem here is bad documentation, which is written in non-reproducible way.
The Rosanne DiMesio's main idea is "People who don't bother to read the directions are always going to have problems.".

So we need to write our own documentation until WineHQ-officials become smarter.

The problem with dependencies was caused by the FAudio dependency, which is not contained in Debian/Ubuntu and WineHQ repositories. We can determine the exact package name by using command below and analyzing of their output:

$ sudo apt-get install wine-stable-amd64
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-stable-amd64 : Depends: libfaudio0 but it is not installable
                     Recommends: libcapi20-3 but it is not going to be installed
                     Recommends: libodbc1 but it is not going to be installed
                     Recommends: libosmesa6 but it is not going to be installed
                     Recommends: libsdl2-2.0-0 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

The aforementioned libfaudio0 package is available only for Ubuntu 19.10 and upcoming 20.04 LTS.


Solution

We need to follow official WineHQ guide for Ubuntu partially:

sudo dpkg --add-architecture i386
sudo apt update

Note: if you have WineHQ repository added - remove it with

sudo apt-add-repository -r 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main' 

to prevent the mess of repositories and then proceed.

Then we need to add other repository from OpenSuse Build Service to get libfaudio0 installed:

wget -q https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/Release.key -O Release.key -O- | sudo apt-key add -
sudo apt-add-repository 'deb https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/ ./'
sudo apt-get update

and only after this install one of WineHQ packages:

# Stable branch     
sudo apt install --install-recommends winehq-stable

#Development branch     
#sudo apt install --install-recommends winehq-devel

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

Just an FYI, the Wine team have no intention of updating their misleading documentation, so this will continue to be problem on any distro based on 18.04 LTS:

The problem is with your system, not the packages.

You are probably missing FAudio, which is now a dependency for wine-stable, as stated clearly at the top of https://wiki.winehq.org/Ubuntu. The wiki also directs users to https://forum.winehq.org/viewtopic.php?f=8&t=32192 for instructions on how to install FAudio for bionic. Apparently you overlooked that part.

If that doesn't fix it, follow the instructions in https://wiki.winehq.org/FAQ#How_do_I_solve_dependency_errors_when_trying_to_install_Wine.3F to figure out exactly what dependencies you are missing. If you need further help, ask for it on the forum. Bugzilla is not for user support.

Friendly.