How to Install WINE on Ubuntu

How to Install WINE on Ubuntu. This compatibility layer allows Linux users to run Windows executables .exe files in Linux. The acronym is actually "WINE is Not an Emulator", because it isn't. But we will get to that here in a bit. This software is not included in default Ubuntu installs, though it is available directly from the official universal or WineHQ Ubuntu repositories.

In the following tutorial, I cover one way to get the missing WINE tool installed on Ubuntu Linux through enabling the Ubuntu universal repository. After installation is complete, we can proceed to run our Windows software executables from Linux.

How does WINE work and Why is it not an Emulator?

Wine works by translating Windows API calls into POSIX. Instead of using virtual machine simulation to emulate logic. Through the use of API to POSIX translation, we can eliminate most of the performance issues found when using alternate methods like emulation. The result is a true integration of Windows applications right into your Linux desktop.
YUMI from WINE on UBUNTU

How to Install WINE on Ubuntu | Universal Repository

To install WINE on Ubuntu we need to add the Universal repository to our sources list, update to refresh packages, and then proceed to install. We will also be installing recommended packages and Winetricks. Here's how it's done:

  1. From the Ubuntu Desktop, Press Ctrl+Alt+T to open a terminal.
    (Then, type or copy and paste the following commands into the open terminal, pressing the Enter key after each command.)
  2. To make sure that the i386 architecture is installed use the following commands;
    sudo dpkg --add-architecture i386 && sudo apt update
  3. To add the Ubuntu universal repository to your list of sources;
    sudo add-apt-repository universe
  4. To update and then install WINE and Winetricks on your Ubuntu system;
    sudo apt update && sudo apt install --install-recommends wine32 winetricks

If all went as planned, you should now be able to run Windows files on Linux with WINE fully installed. Ready to run .exe files using the terminal from within your Ubuntu Linux Desktop. You can check that WINE is installed by issuing the following command:

wine --version

You can also run the winecfg command to check or setup your WINE configuration.

winecfg

How to run WINE from the Terminal

You should be aware that the universal repository does not include the "Wine Windows Program Loader". You will need to use either the "wine" or "wineconsole" commands from within a terminal to execute your files. To do this, you can change directory (cd) to the path of your Windows executable files to run them or include the path with the command.

For example, to run a file named filename.exe from the current directory in wine, you would enter:

wine filename.exe

Notice the you could also have your batch programs launch from a Windows command prompt:

wine cmd /c filename.bat

or for wineconsole:

wineconsole filename.exe

To run a file from wine named filename.exe including the full path to the file:

wine ./path_to_filename/filename.exe

Installing WINE on Ubuntu from WineHQ Repository

The following is based on the official method supported by WineHQ Ubuntu. It will allow you to install the latest version of WINE for Ubuntu along with the "Wine Windows Program Loader". Here's how:

  1. From your Ubuntu desktop, Press Ctrl+Alt+T to open a terminal.
  2. First enter the following command to ensure you have the 32bit architecture installed:
    sudo dpkg --add-architecture i386
  3. Then, to make a keyring:
    sudo mkdir -pm755 /etc/apt/keyrings
  4. Next, to import the winehq repository key:
    sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
  5. Now, to add the repository to your sources use one of the following sources:
    For Ubuntu 20.04 "Focal Fossa" or Linux Mint 20.x, use the following source repo:

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

    For Ubuntu 22.10 "Kinetic Kudu" use:

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

    For Ubuntu 23.04 "Lunar Lobster" use:

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

    For Ubuntu 22.04 LTS  "Jammy Jellyfish" or Linux Mint 21.x, use:

    sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources
  6. Finally, to install WINE software on Ubuntu, enter the following:
    sudo apt update && sudo apt install --install-recommends winehq-stable -y

You should now proceed to test that WINE for Ubuntu is actually working properly. To do this, right click on a Windows executable file. Then, select the option to Open with Wine Windows Program Loader.

Install WINE on Ubuntu