install wine in ubuntu

A lot of games have been ported to run natively on Linux and there are excellent alternatives to most software. Despite this, users still encounter situations where a virtual machine (VM) or a compatibility layer like Wine is required.

If your system has resources to spare, I recommend installing Windows on a VM as programs often don’t work smoothly with Wine. However, if Wine feels like a better fit for your needs, you can follow the steps from this article to install, configure, and get started with it.

Enable Multi-Arch Support

Most modern systems are 64-bit, meaning you’ll need to manually enable 32-bit support. This’ll allow you to install both the amd64 (64-bit) and i386 (32-bit) parts of Wine. 

sudo dpkg --add-architecture i386

Now, update the package index to include the 32-bit packages in your sources list.

sudo apt update

Add WineHQ Repo

You can install Wine directly from the Ubuntu repos too, but this version is rarely up-to-date. So, we recommend adding the official WineHQ repo as that’ll allow you to install the latest version, as well as older versions if required.

The command below will download the WineHQ sources file for Ubuntu 22.04 (Jammy Jellyfish). If you’re running a different Ubuntu version, change jammy to lunar, kinetic, focal, and so on according to your version when running the command. 

sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources

Now, update the package index again.

sudo apt update

Install Wine

You can now install Wine from the stable, development, or staging branches. As the name implies, the stable version is best suited for most users as it’s the most reliable.

sudo apt install --install-recommends winehq-stable
sudo apt install --install-recommends winehq-devel
sudo apt install --install-recommends winehq-staging

The latest stable version is generally the best choice. But if you want to install an older Wine version, you can specify the branch and version like so

sudo apt install winehq-<branch>=<version>
sudo apt install winehq-stable=7.12~bookworm-1

Afterward, you can verify the installation by checking the Wine version.

wine --version

Get Started with Wine

For the first launch, you should initialize the Wine environment with the wineboot command. This’ll create the Wine prefix directory at ~/.wine and also prompt you to install wine-mono.

wineboot

Afterward, you can launch programs from the terminal in the following format.

wine program.exe

Certain apps like Notepad, the clock app, IExplorer browser, etc. are included by default. Let’s try launching Notepad for now.

wine notepad.exe

Now, let’s say you’re trying to run a program that’s not preinstalled (e.g., Notepad++). Download the executable and launch it in the same manner.

wine ~/Downloads/npp.8.5.3.Installer.x64.exe

Alternatively, you can also launch a program from the GUI. Right-click the executable from the file explorer and select Open With Another Application > Wine Windows Program Loader.

Follow the on-screen instructions to install the program. Once you’re done, you’ll be able to launch the program directly from your Applications menu.

Managing Wine On Ubuntu

Wine usually runs well out of the box, but if you eventually need to change some configs, you can use the GUI configuration tool.

wine winecfg

In terms of updates, the bleeding-edge versions are obviously updated frequently, but even the stable branch of wine gets major updates quite often. To update to a newer version (if available), you can run

sudo apt update && sudo apt install --only-upgrade winehq-stable

If you want to uninstall some program, you can use the uninstaller with

wine uninstaller

And finally, if you need to uninstall Wine itself (to install a different version for instance), you can remove or purge it like so

sudo apt purge winehq-stable

Afterward, manually delete the following directories if required.

rm -rf ~/.wine
rm -rf ~/.local/share/applications/wine
Anup Thapa

Senior Writer

Anup Thapa is a Linux enthusiast with an extensive background in computer hardware and networking. His goal is to effectively communicate technical concepts in a simplified form understandable by new Linux users. To this end, he mainly writes beginner-friendly tutorials and troubleshooting guides. Outside of work, he enjoys reading up on a range of topics, traveling, working out, and MOBAs.