×


Install Wine on Ubuntu 20.04 LTS - Step by step process to do it ?

Platform-specific applications often require compatibility software to run on another operating system.
Wine is also a compatibility software that helps users run Windows-based applications on other operating systems like Linux platforms and macOS etc.
This software has no limitations and allows an easy integration of Windows operating system on other platforms.
Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform Software Installation tasks on their Linux Server.
In this context, we shall look into how to install Wine on the Ubuntu 20.04 system.

How to install Wine on Ubuntu 20.04 ?

To begin, you need to log into your Server with the root account or user account with sudo rights.
Then once logged in, follow the steps given below:

1. Check the installed architecture

To install Wine, users need to check computer architecture to fulfill the software requirements. So, the first step is to check the architecture of the computer system. Open up the terminal using the Ctl+Alt+T shortcut or go to the Applications Terminal in your Ubuntu system.
Once opened, you need to type the following command in the command-line:

$ dpkg --print-architecture

In case if your system has 64-bit architecture enabled, then you will need to enable 32-bit architecture as well to meet the requirements of the software.
Run the following command to do so:

$ dpkg --print-foreign-architectures

This command should respond with “i386” output.

If i386 is not displayed in the output then users need to type the following command in their terminal window:

$ sudo dpkg –add-architecture i386

The system might ask for the password of the sudo user.
Provide the password of the logged-in user to proceed with the enablement and press the <enter> key.
Once you have enabled the architecture, you can check the status of installation by using:

$ dpkg –print-foreign-architectures 

The output will show that the required architecture is now enabled.

2. Get and Install the WineHQ Ubuntu repository

To get the WineHQ, install all dependencies needed for Ubuntu 20.04. Use the following command:

$ wget -nc https://dl.winehq.org/wine-builds/winehq.key

To install the package run the following command:

$ sudo apt-key add winehq.key

You will see an OK in the output which means that WineHQ repository key is installed in your computer system.

3. Download and Install Repository Key

Now you need to download and install the WineHQ repository using the following command:

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

4. Update database package

After that, you need to update the package database. It can be done by using:

$ sudo apt update

5. Install Wine

Here we will install Wine Stable in Ubuntu 20.04.
To do so, use the following command.

$ sudo apt install --install-recommends winehq-stable

Users can either use Wine Development or Wine Staging by simply replacing winehq-stable with winehq-devel or with winehq-staging in the above-mentioned command.
The installation of Wine will begin.
The system will ask for your confirmation after some time. Type Y to proceed with the installation process.

How to verify installation of Wine ?

To verify the installation of Wine in your system, simply type the following command in the terminal window:

$ wine --version

This will display the version of Wine Installed on your Ubuntu System.

How to uninstall Wine from Ubuntu system?

i. To uninstall Wine, simply go to the command line and type the following:

$ sudo apt-get purge winehq-stable

ii. Once you press the <enter> key, the system will ask for the password of the sudo user.
iii. Provide the password to proceed with the uninstallation of Wine.
iv. Once done, hit <enter> key.
v. After that, enter Y and press <enter> to confirm your selection.
The uninstallation process will begin.
The directories and the WineHQ-stable package will be removed from the Ubuntu 20.04 system.
Finally, the uninstallation process will be completed.

[Need urgent assistance to install Software on Ubuntu Server? We are available to help you today. ]


Conclusion

This article covers how to install Wine on Ubuntu 20.04. We used the WineHQ repositories and downloaded them directly for their installation.
Users can use it now for running all Windows-based applications.

To Install Wine from a Standard Ubuntu Repository (recommended):
We recommend that you install Wine on your system through the standard Ubuntu repository, as this way you can have a more stable version on your system.
1. Run the following command in the Terminal as a root user in order to install Wine on a 64-bit version of Ubuntu:
$ sudo apt install wine64
2. Please enter y when you are prompted with a y/n option for installation.
After that, the Wine application will be installed and ready for use.
3. For a 32-bit Ubuntu system, you can use the following command:
$ sudo apt install wine32
4. You can verify the version of Wine through the following command:
$ wine --version

To Install Wine without Internet:
To install Wine on an Ubuntu machine without internet access, you must have access to a second Ubuntu machine (or VM) with an internet connection to download the Wine .deb package and its dependencies.
On the machine with internet, add the WineHQ repository and run apt update.
Next, cache just the packages necessary for installing wine, without extracting them:
sudo apt-get clean
sudo apt-get --download-only install winehq-devel
sudo apt-get --download-only dist-upgrade

Copy all of the .deb files in /var/cache/apt/archives to a USB stick:
cp -R /var/cache/apt/archives/ /media/usb-drive/deb-pkgs/

Finally, on the machine without internet, install all of the packages from the flash drive:
cd /media/usb-drive/deb-pkgs
sudo dpkg -i *.deb