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.
- A user account with sudo privileges
- Ubuntu 18.04 LTS Desktop Installed
- Access to a terminal window/command-line (Ctrl-Alt-T)
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
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:
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.
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 https://dl.winehq.org/wine-builds/winehq.key
sudo apt-key add winehq.key
The signing key verifies authentic software is being installed.
4. Next, add the Ubuntu 18.04 software repository to download from:
sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ 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
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:
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
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
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
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
How to Uninstall Wine From Ubuntu
To uninstall wine:
sudo apt remove wine[version]
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.