Site icon Linux Genie

How to Install Wine on Ubuntu 24.04

Install wine on ubuntu

Wine is not an emulator, it’s just a conversion layer that allows you to run Windows programs (*.exe, .msi) programs to run on Linux. Programs like Rufus are not directly supported on Ubuntu (or any other Linux distribution). To run these kinds of programs, you have to install Wine on Ubuntu (or any distro you want to).

Recently, Ubuntu’s latest LTS is released, Ubuntu 24.04, noble numbat. Likewise, a few months ago Wine also released its yearly version, i.e., Wine 9.

Let’s see how we can install the Wine on the latest LTS of Ubuntu 24.04, codenamed Noble Numbat.

Outline

How to Install Wine on Ubuntu 24.04

To install Wine on Ubuntu 24.04, you have two methods, i.e., WineHQ Repository and Ubuntu Default Repositories. These methods might get you a different version but they are safe and have the tested version available. Let’s dig into these methods one by one:

Using WineHQ Repository | Most Updated

With WineHQ, you can get the stable, development, and staging releases of the Wine. Every latest release is available there. Here are the steps to install Wine from the WineHQ repository:

Step 1: Enable the 32-bit Architecture Support

If your system has the 64-bit architecture then enable the support for 32-bit applications using the command:

sudo dpkg --add-architecture i386

By default, the 64-bit system might not be able to run the 32-bit applications:

Step 2: Get the Repository Key

Add the repository key of the WineHQ repository:

sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key

Note: The “/etc/apt/keyrings” if the keyrings directory is not available, create it using the command:

sudo mkdir -pm755 /etc/apt/keyrings

Step 3: Add the WineHQ Repository

Now, add the WineHQ repository to the sources list of your Noble Numbat:

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

While writing this post, WineHQ has not yet provided the repository support for Ubuntu 24.04. However, you can add Jammy’s WIneHQ which works fine:

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

While writing this, WineHQ is not available for the Noble Numbat. However, you can add Jammy’s repository and it will work fine:

Now, update the core libraries of the system to load the latest packages:

sudo apt update

Step 4: Install the Required Wine Variant

WineHQ offers multiple variants of Wine, which you can choose from. Here is a detailed description of each variant and the command to install it.

  • Stable Release | Recommended for Regular Users

This stable release has been tested and is the most reliable variant for regular users. Use the below command to get the latest stable release:

sudo apt install --install-recommends winehq-stable

  • Development Release | Recommended for Users Who Require Latest Features

It contains the new features (not available in the stable) but has a rolling release. This release is not stable, new features are added frequently and thus recommended for rare usage such as testing, etc.

sudo apt install --install-recommends winehq-devel
  • Staging Release | For Developers

This wine release leads to the development version, i.e., the phase where the development release is being built. You can install it using the command:

sudo apt install --install-recommends winehq-staging

Step 5: Verify the Installation

To verify, you can check the installed version of Wine:

Wine 9 is the latest stable release at the time of writing this post. Let’s see which version the default repositories method offers.

Ubuntu Default Repositories | Latest Available on Repository

Ubuntu default repositories also contain the latest test release for Ubuntu. To Install Wine from Ubuntu’s repositories, follow the below steps:

Step 1: Update the Core Libraries

Since we are installing Wine from Ubuntu’s repository, so let’s update the packages list first:

sudo apt update

Step 2: Install Wine

Ubuntu default repositories contain the package named “wine”, which can be installed using the command:

sudo apt install wine

Step 3: Verify the Installation

Let’s verify the installed version:

Interestingly, both the sources (WineHQ repository and Ubuntu default repositories) have resulted in the same version, i.e., wine 9.0.

How to Setup Wine on Ubuntu 24.04

Once the Wine has been installed, you need to configure it before getting started. The configuration includes a selection of the Windows version, creates a Wine home directory, arranges the desktop settings, or the audio etc. Let’s demonstrate these steps:

Configure Wine on Ubuntu 24.04

Open the terminal and ensure that the WIne is already installed. Now, use the below command to initiate the necessary configuration process:

winecfg

Upon execution, the command sets up the configuration environment from where you have run the command, i.e., “home/adnan/.wine”:

Soon after the configuration, a new prompt appears, which asks you to select your Windows version:

After the Windows version selection, you can configure the Graphics, Audio, About, Drivers, and more. That’s it, now you can use hassle-free Wine on Ubuntu 24.04.

Install a Windows Application

The Microsoft-based installations are carried out through the .exe or the .msi file. Both these files follow different installation commands. Thus, you have to be cautious while installing the application. You need to download the “.exe” or “.msi” file and get to the relevant command to install it:

  • Installing an EXE-based Package

Use the “wine” keyword and the path of the exe file:

wine <path-to-exe-file>

Follow the onscreen instructions and install it.

  • Installing an MSI-based Package

For installing a msi-based file, you have to use the “msiexec” keyword followed by the path of the msi file:

wine msiexec /i <path-to-msi_file>
  • Install an MSI and EXE Based Package Using the Wine Uninstaller

Apart from the dedicated way of installing an exe or the msi file, that is Wine uninstaller. It provides an interactive way to install the downloaded MSI and EXE-based files. Moreover, you can uninstall the installer package’s files as well.

To launch the wine uninstaller, you can use the command:

wine uninstaller

Here, you have the following interface. Click on the “Install” button to load the package from the local location and then install it:

Proceed with the on-screen instructions to get it installed:

Launch the Application

Most of the applications are equipped with the GUI and once installed you can easily launch them from the applications menu:

Moreover, you can also launch the application using the wine keyword followed by the name of the app, as shown below:

Let’s see the possible removal methods.

Uninstall/Remove a Windows-based application

The wine uninstaller command is used to remove/uninstall the exe or msi-based installations. When you run the “wine uninstaller” command, you will get the installed applications on the front screen:

Next, you have to just follow the onscreen instructions to complete the uninstallation:

That’s how you can configure, and play with Wine on Ubuntu 24.04.

How to Remove Wine From Ubuntu 2.04

The removal of the Wine depends upon the installation medium of Win, i.e., whether it is installed from the WineHQ repository or the default repositories.

If Installed From the WineHQ Repository

As we have installed the stable version from the WineHQ repository, thus it can be removed using the command:

sudo apt autoremove winehq-stable --purge

However, if you have installed the staging or development release, you need to use the relevant name while removing the Wine, i.e., winehq-devel for development and winehq-staging for staging release.

If Installed From the Default Repositories

The default repositories contain the package name, i.e., wine. Thus, you can remove wine alongside the dependencies and configurations using the command:

sudo apt autoremove wine --purge

That’s all from this guide.

Bottom Line

Wine can be installed from the WineHQ repository or the Ubuntu default repositories. Recently, Wine has introduced its latest release 9.0 and interestingly both methods offer this latest version.

WineHQ provides more control over the variants of Wine, i.e., it offers stable, development, and staging variants. Whereas the Ubuntu default repositories only offer a stable release.

It is recommended to install wine from the WineHQ repository as it is always a bit more updated than the default repositories-based method.

Exit mobile version