To run Microsoft Windows applications in Ubuntu Linux, Wine or CrossOver (paid version) is a good choice. And here’s how to install and use Wine in Ubuntu 22.04 LTS, Ubuntu 24.04, and Ubuntu 20.04
In this tutorial, you’ll see 2 ways to install Wine in Ubuntu. Choose either one that you prefer.
NOTE: NOT all Windows apps can install & run through Wine. See this page for the list of apps compatible with Wine.
Option 1: Install Wine from Ubuntu repository:
Ubuntu included Wine package in its own repository, though it’s old. User may simply press Ctrl+Alt+T on keyboard to open terminal and run command to install it:
sudo dpkg --add-architecture i386 && sudo apt install wine
Type user password (no asterisk feedback) and hit Enter to authentication for sudo.
After installed package run winecfg in terminal to generate configuration file. And, run command to make link the .desktop
file:
sudo ln -s /usr/share/doc/wine/examples/wine.desktop /usr/share/applications/
Finally, you may right-click on an EXE file to run via “Wine Windows Program Loader” option:
Option 2: Install Latest Wine 9.x from its official repository:
The Wine developer team provides an official apt repository for Debian/Ubuntu based systems. Now the repository contains Wine 9.0.x stable, and 9.x Dev versions.
The repository so far supports Ubuntu 20.04, Ubuntu 22.04, and Ubuntu 24.04! It also works for Ubuntu 16.04 and Ubuntu 18.04, but old versions will be installed (Wine 5.0.3 for 16.04, and Wine 8.0.1 for 18.04).
1. Install Wine key
The repository now has updated with new method to install the key to follow Debian policy, as apt-key is deprecated. However, it’s still ASCII-armored key so far.
Press Ctrl+Alt+T on keyboard to open terminal. When it opens, create the directory for storing the keys:
sudo mkdir -p /etc/apt/keyrings
Then, run the single command to download the key, dearmor, and move to “/etc/apt/keyrings” directory:
wget -qO - https://dl.winehq.org/wine-builds/winehq.key | gpg --dearmor | sudo tee /etc/apt/keyrings/winehq-archive.key
Type user password (no visual feedback) when it asks. And, the command should output unreadable text as the screenshot below shows you:
2. Add Wine repository:
Next run the commands below one by one to download the repository setup file and move to “/etc/apt/sources.list.d” directory.
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/$(lsb_release -sc)/winehq-$(lsb_release -sc).sources
NOTE: This command is for Ubuntu only. “$(lsb_release -sc)
” returns system’s code-name. For Linux Mint and other Ubuntu based system, replace it with jammy
(22.04), focal
(20.04), or noble
(24.04) depends on which Ubuntu edition your system is based on.
If you don’t know which Ubuntu edition you system is based on, run cat /etc/os-release
to tell through UBUNTU_CODENAME
section.
3. Update cache
Before installing any package from that repository, you need to refresh system cache by running command in terminal:
sudo apt update
4. Install Wine:
The Wine repository provides three Wine packages:
- winehq-stable – the stable version (v9.0.x so far)
- winehq-devel – the latest development release.
- winehq-staging – the testing version with patches applied on top of the corresponding wine-devel
Select install one of the packages by running command below in terminal:
- To install the stable edition use command:
sudo apt install winehq-stable
- Install wine development release via:
sudo apt install winehq-devel
- Or install wine-staging via command:
sudo apt install winehq-staging
NOTE: It does not re-build old packages for new Linux systems. winehq-stable
so far is not available for Ubuntu 22.04, since the new LTS is released after wine stable 7.0. User may wait for the next stable release (v7.0.1 or v8.0).
After installation, right-click on your EXE file and start it via Wine program loader option. See if your app works with wine.
How to Remove Wine:
1. To remove the Wine package, simply open terminal and run commands:
sudo apt remove wine winehq-stable winehq-staging winehq-devel
There will be local configuration files and app data left under .wine and .local/share/applications. They are hidden folders, press Ctrl+H in file manager to toggle display and remove them as you want.
2. To remove the Wine repository, open terminal (Ctrl+Alt+T) and run command:
sudo rm /etc/apt/sources.list.d/winehq-*.sources
And remove the repository key via command:
sudo rm /etc/apt/keyrings/winehq-archive.key
Finally apply changes by running sudo apt update
to refresh system package cache.