How to Install and Use Wine on Ubuntu 18.04

Updated on

4 min read

Install Wine on Ubuntu 18.04 Linux

Wine is an open-source compatibility layer that allows you to run Windows applications on Unix-like operating systems such as Linux, FreeBSD, and macOS. Wine stands for Wine Is Not an Emulator. It is an interface that translates Windows system calls into equivalent POSIX calls used by Linux and other Unix-based operating systems.

Wine isn’t always the best option to run Windows programs on Linux. Not all Windows applications will run in Wine, even if they do, they may not behave in the same way that they normally would. The Wine AppDB database contains a list of applications that have been tested and confirmed to work under Wine.

You can also use a virtualization tool like VirtualBox or VMware , but they require more system resources and a Windows installation.

This tutorial explains how to install Wine on Ubuntu 18.04. We will show you how to install the distro stable version 3.0 and the latest version of Wine 5.0. The same instructions apply for Ubuntu 16.04 and any Ubuntu-based distribution, including Linux Mint and Elementary OS.

Prerequisites

To be able to install new packages on your Ubuntu system, you must be logged in as a user with sudo privileges .

Installing Wine 3.0 on Ubuntu

The Wine packages are included in the default Ubuntu repositories can be easily installed with the apt package manager. This is the easiest way to install Wine on Ubuntu. However, the version included in the repositories may lag behind the latest version of Wine.

If you are running a 64-bit Ubuntu system, you should enable multiarch, which allows you to install both 64 and 32-bit packages on the same machine. This is needed because most of the Windows applications are 32-bit.

Start by enabling the 32-bit architecture and updating the packages list:

sudo dpkg --add-architecture i386sudo apt update

Install Wine by typing the following command:

sudo apt install wine64 wine32

Once the installation is complete use the wine --version command to print the Wine version:

wine --version

At the time of writing this article, the current version of Wine available in the Ubuntu 18.04 repositories is 3.0.

wine-3.0 (Ubuntu 3.0-1ubuntu1)

That’s it. Wine 3.0 has been installed on your Ubuntu machine.

Installing Wine 5.0 on Ubuntu

At the time of writing this article, the latest major release of the Wine is version 5.0.

In this section, we will provide a step by step instructions about how to install Wine version 5.0 on Ubuntu 18.04.

If you are running 64-bit Ubuntu system enable the 32-bit architecture and update the packages list:

sudo dpkg --add-architecture i386sudo apt update

Import the WineHQ repository’s GPG key using the following wget command:

wget -qO- https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -

Add the WineHQ repository to your system:

sudo apt install software-properties-commonsudo apt-add-repository 'deb http://dl.winehq.org/wine-builds/ubuntu/ bionic main'

Wine 5.0 depends on the FAudio package, which is not included in the default Ubuntu 18.04. We’ll install FAudio from the OBS repository. Enter the command below to import the GPG key and enable the OBS repository:

wget -qO- https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/Release.key | sudo apt-key add -sudo sh -c 'echo "deb https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/ ./" > /etc/apt/sources.list.d/obs.list'sudo apt update

Install Wine 5.0 package by typing:

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

This will install a bunch of packages. Once completed, verify the Wine installation by typing:

wine --version

The output should look something like this:

wine-5.0

At this point, Wine 5.0 has been installed and ready to be used.

Configuring Wine

To configure Wine run the winecfg command in your terminal which will install Mono and Gecko and set up the Wine environment:

winecfg

A dialog will appear asking whether you want to install the wine-mono package:

Ubuntu winecfg mono

Click on the “Install” button, and the installation will start. Once done, a new dialog will appear prompting you to install Gecko. Again click on the “Install” button.

Ubuntu winecfg gecko

When the installation is completed, the Wine configuration dialog will be shown. Here you can configure various Wine settings. The default settings should be fine in most cases. Once finished, close the dialog box.

Ubuntu wine configuration

Installing Notepad++ on Ubuntu

Now that Wine is installed and configured, we will explain how to install Windows applications on your Ubuntu.

In this tutorial, we will install Notepad++, which is is one of the most popular text editors among Windows users. Launch your browser and download the Notepad++ installation file from the Notepad++ download page .

Once the download is complete, start the installation by right-clicking on the .exe file and selecting “Open With Wine Windows Program Loader”.

Ubuntu Notepad++ download

The installation wizard will start, select the language and install Notepad++ in the same way as you would install any application on your Windows computer.

Ubuntu Notepad++ install

Windows applications are installed in the ~/.wine/drive_c/ directory.

To start the Notepad++ editor navigate to the ~/.wine/drive_c/Program Files (x86)/Notepad++ directory.

Ubuntu Notepad++ Start

And double click on the notepad++.exe file.

Ubuntu Notepad++

Conclusion

You have successfully installed and configured Wine on your Ubuntu 18.04 desktop. We have also shown you how to install and start Windows applications under Wine.

If you hit a problem or have feedback, leave a comment below.