Wine Setup

You need to know your Ubuntu version.

Check your Ubuntu version using any one of the following commands...

  1. lsb_release -d
  2. cat /etc/issue
  3. hostnamectl

Let us check the output from lsb_release -d.

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.5 LTS
Release:        18.04
Codename:       bionic

Note down the codename which is "bionic" in my case. Replace that name in the below command

sudo apt-add-repository 'deb <code_name>'

Now run following commands...

sudo dpkg --add-architecture i386
wget -nc; sudo apt-key add winehq.key
sudo apt-add-repository 'deb bionic main'

You might see following error while installing wine stable.

winehq-stable : Depends: wine-stable (= 5.0.2~bionic) but it is not going to be installed

Make sure you install following to avoid above error.

sudo apt-get install libgnutls30:i386 libldap-2.4-2:i386 libgpg-error0:i386 libxml2:i386 libasound2-plugins:i386 libsdl2-2.0-0:i386 libfreetype6:i386 libdbus-1-3:i386 libsqlite3-0:i386

Add following repository

sudo add-apt-repository ppa:cybermax-dexter/sdl2-backport

Apt Install Winehq-stable

sudo apt update && sudo apt install --install-recommends winehq-stable

Verify Wine Installation

Run following command to check Wine Installation...

wine --help
Usage: wine PROGRAM [ARGUMENTS...]   Run the specified program
       wine --help                   Display this help and exit
       wine --version                Output version information and exit