How To

Install Wine on Ubuntu 18.04: Run Windows Apps on Linux

Wine (short for “Wine Is Not an Emulator”) is a compatibility layer that lets you run Windows applications on Linux, macOS, and FreeBSD. Instead of emulating Windows hardware, Wine translates Windows system calls into equivalent POSIX calls that Linux understands natively.

This means you can run many Windows programs directly on Ubuntu without needing a Windows license or a separate Windows installation. Unlike virtual machines like VirtualBox or VMware, Wine does not need its own operating system and uses far fewer system resources.

Wine is not perfect. Not every Windows app will work, and some may behave differently than expected. Check the Wine AppDB database to see if your application is known to work before you start.

This guide shows you how to install Wine on Ubuntu 18.04 using the default repositories (version 3.0) or the official WineHQ repository for version 5.0. The same steps apply to Ubuntu 16.04 and other Ubuntu-based distributions.

Prerequisite: You need sudo access to install packages.

Method 1: Install Wine on Ubuntu from Default Repos

This is the easiest way to get Wine running. The version in Ubuntu’s repositories is 3.0, which is stable and works for most common use cases.

Most Windows applications are 32-bit, so first enable 32-bit architecture support:

bashsudo dpkg --add-architecture i386sudo apt update

Install Wine:

bashsudo apt install wine64 wine32

Verify the installation:

bashwine --version

Output:

wine-3.0 (Ubuntu 3.0-1ubuntu1)

Wine 3.0 is now installed on your Ubuntu machine.

Method 2: Install Wine 5.0 from WineHQ

If you need a newer version of Wine, install it directly from the official WineHQ repository. This gives you Wine 5.0, the latest stable release at the time of writing.

Enable 32-bit architecture and update:

bashsudo dpkg --add-architecture i386sudo apt update

Import the WineHQ GPG key:

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

Add the WineHQ repository:

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

Wine 5.0 depends on the FAudio package, which is not in Ubuntu 18.04’s default repositories. Add the OBS repository to get it:

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

Install Wine 5.0:

bashsudo apt-get install --install-recommends winehq-stable

Verify the installation:

bashwine --version

Output:

wine-5.0

Configure Wine

Before running any Windows app, set up the Wine environment:

bashwinecfg

This command installs two important components:

  • Wine Mono – provides a .NET framework implementation so .NET-based Windows apps can run
  • Wine Gecko – provides a web rendering engine for apps that use embedded browsers

Two dialogs appear one after the other. Click Install for both. Once done, the Wine configuration window opens. The default settings work fine for most applications. Review them if needed and then close the window.

Run a Windows App with Wine

With Wine configured, you can install and launch Windows applications on your Ubuntu desktop.

Here is how to install Notepad++ as an example:

  1. Download the Notepad++ .exe installer from the Notepad++ download page
  2. Right-click the .exe file and choose Open With Wine Windows Program Loader
  3. The installation wizard launches. Follow the same steps you would on a Windows machine

Windows apps are installed in the ~/.wine/drive_c/ directory. To launch Notepad++, navigate to ~/.wine/drive_c/Program Files (x86)/Notepad++/ and double-click notepad++.exe.

You can also launch it from the terminal:

bashwine ~/.wine/drive_c/Program\ Files\ \(x86\)/Notepad++/notepad++.exe

Wine is now installed and configured on your Ubuntu 18.04 system. You can start running Windows applications without leaving Linux. For apps that do not run well in Wine, a full virtualization setup with KVM or VirtualBox is your next best option. Got questions? Leave a comment below.

Cyber Defence

Recent Posts

Configure a Static IP Address on Ubuntu 18.04: Netplan Guide

Setting a static IP address on your server is a smart move. It ensures your…

1 hour ago

Install Xrdp on Ubuntu 18.04: Remote Desktop Setup Guide

Xrdp is an open-source implementation of the Microsoft Remote Desktop Protocol (RDP). It lets you access…

1 hour ago

Add and Delete Users on Ubuntu 18.04: A Practical Guide

Managing user accounts is one of the most basic system administration tasks on any Linux…

2 hours ago

Install KVM on Ubuntu 18.04: Setup, Network, and Create VMs

KVM (Kernel-based Virtual Machine) is an open-source virtualization technology built into the Linux kernel. It lets…

2 hours ago

Upgrade to Ubuntu 20.04 LTS: Prepare, Update, and Confirm

Ubuntu 20.04 LTS (code name Focal Fossa) was released on April 23, 2020. It is a…

1 day ago

Install Google Chrome on Ubuntu 20.04: Download and Setup Guide

Google Chrome is the most widely used web browser in the world. It is fast, secure,…

1 day ago