How to Install Wine 4 on Ubuntu 18.04

June 5, 2019


Wine is an application that allows you to run Windows programs on a Linux system. Wine is similar to an emulator, but with a different technology that improves performance.

In this tutorial learn how to install Wine 4.0 on Ubuntu 18.04.

tutorial on how to install wine on ubuntu 18.04


Install Wine from Ubuntu Repository

Step 1: Verify Ubuntu 32-bit or 64-bit system

Wine uses a different application for 32-bit and 64-bit versions of Ubuntu.

To view CPU details, enter the command:


The CPU op-mode(s) field tells you which architecture you are using:

CPU op-mode(s): 32-bit: You have a 32-bit OS
CPU op-mode(s): 64-bit: You have a 64-bit OS
CPU op-mode(s): 32-bit, 64-bit: You support both

Check CPU architecture with lscpu

Step 2: Install Wine 4.0 from Default Repositories

Installing Wine from the default Ubuntu repositories is the easiest option. However, be aware that it may not provide the latest version.

1. Start by updating the apt repository package list. This ensures the latest stable version of Wine is installed.

sudo apt upgrade

2. To install 64-bit Wine, enter the following:

sudo apt install wine64

To install 32-bit Wine, enter the following:

sudo apt install wine32

Step 3: Verify Wine Version Installed

After the operation completes, verify the installation by checking the running version:

wine --version
output that was is not installed

The image above indicates that Wine32 is not installed. However, Wine64 is installed, and the version is 3.0.

Installing Wine from the official Ubuntu repository will always provide a stable install. However, the repositories may not include the latest versions.

Alternative Option: Install Wine From WineHQ Repository

If you need a more recent version of Wine, install it on Ubuntu from the developers’ repositories.

1. Make sure Wine is not already installed by checking the version.

wine --version

2. To get the package name, enter the following:

sudo apt list -installed | grep -i wine

If you are using a 64-bit OS, start by enabling 32-bit architecture:

sudo dpkg --add-architecture i386

3. Add the signing key:

wget -nc
sudo apt-key add winehq.key

The signing key verifies authentic software is being installed.

signing key of wine

4. Next, add the Ubuntu 18.04 software repository to download from:

sudo apt-add-repository 'deb bionic main'

5. Update the package lists:

sudo apt update

6. To Install the latest stable release of Wine 4, use the command:

sudo apt install --install-recommends winehq-stable

7. To install the latest development release of Wine 4, use the command:

sudo apt install --install-recommends winehq-devel

Note: The apt package manager typically handles any dependencies. If you get an error that a dependency is missing during the Wine installation, install each missing dependency with the command:

sudo apt install <package_name> 

Then rerun the installation command.

Get Started Using Wine

Launching Applications

If you’re running a GUI on Ubuntu, double-click a Windows .exe file to launch it. Wine automatically associates itself with the .exe file extension. You can also right-click the application and select Open With > Wine.

To launch an application from the command line, enter the following:

cd '/.wine/drive_c/program_folder'
wine launcher.exe

It’s essential to change the working directory to the location of the application files. Replace program_folder with the actual directory that holds the application. Replace launcher.exe with the executable file for the application.

Wine Start Command

The wine start command is more robust than the basic wine command. It allows Wine to handle the working directory. Use it to specify a path to a specific location:

wine start 'C:\program_location\launcher.exe'

Specify a Linux path:

wine start /unix "$HOME/program_location/installer.exe

Use the wine or wine start command to launch the installer for the Windows application.

To download an installer to a local directory, use wget and then use the wine command to launch the installer. The application installs as it would on Windows. When installing from a disc, use the wine start command to specify the path to the installer. Use this to change drives in the middle of installation, if needed.

For security, do not run wine as a root user. Doing so can allow viruses and malware to infect your system.

How to Update Wine

Wine is updated frequently. To manually update wine, use the command:

sudo apt-get upgrade winehq-stable

Replace stable with devel for the developer version.

Stable releases come out every 10-12 weeks. Developer updates come out much more frequently.

By default, wine creates an installation directory in the home directory. It uses a virtual c:\ drive to interpret commands. You can find this directory at /$HOME/.wine/drive_c/.

How to Uninstall Wine From Ubuntu

To uninstall wine:

sudo apt remove wine[version]

Instead of wine[version], type wine64 or wine32 according to the version you have installed (32-bit or 64-bit).

That command removes Wine, but not its dependencies. To remove all unnecessary dependencies, run the command:

sudo apt autoremove

Removal of these remaining folders needs to be done manually. Run the following commands:

rm -rf $HOME/.wine
rm -f $HOME/.config/menus/applications-merged/wine*
rm -rf $HOME/.local/share/applications/wine
rm -f /.local/share/desktop-directories/wine*
rm -f /.local/share/icons/????_*.xpm

After deleting the files and directories, run:

sudo apt-get remove -purge wine

Now to correct any installation errors, run:

sudo apt-get update
sudo apt-get autoclean
sudo apt-get clean
sudo apt-get autoremove

Wine should now be totally removed from your system.


Wine is a powerful tool that allows you to run Windows programs in Linux. This guide provides a solid start for installing and running wine on Ubuntu.

If you are using a different flavor of Linux, we have this tutorial also available for CentOS 7.

Was this article helpful?
Dejan Tucakov
Dejan is the Head of Content at phoenixNAP with over 7 years of experience in Web publishing and technical writing. Prior to joining PNAP, he was Chief Editor of several websites striving to advocate for emerging technologies. He is dedicated to simplifying complex notions and providing meaningful insight into data center and cloud technology.
Next you should read
How To Install Ruby on Ubuntu 18.04
February 25, 2019

In this article, you will find three options to install Ruby for Ubuntu 18.04: either from the Ubuntu...
Read more
How to Install the LAMP Stack on Ubuntu 18.04
March 6, 2019

A LAMP stack is a set of open source software used for web application development. For a web application to...
Read more
How to Install a Desktop (GUI) on an Ubuntu Server
May 16, 2019

Want to add a desktop environment after you install Ubuntu server? By default, Ubuntu Server does not include...
Read more
How to Install Wine 4.0 on CentOS 7
July 13, 2019

Wine is free software that allows you to run Windows applications on other systems, including Linux, Mac...
Read more
  • © 2021 Copyright phoenixNAP | Global IT Services. All Rights Reserved.