How to Install Wine 9 on Debian 12


Being a Linux user, have you ever run a Windows program on Linux? Well, we are here to introduce Wine which is a compatibility layer of Windows applications for Linux/BSD/UNIX-inspired.

Wine adds an additional layer to the system to interpret the Windows applications for UNIX/Linux-based systems. Wine does not consume dedicated system resources (CPU, RAM, or Storage) like a virtual machine. That’s why it is “Wine Is Not An Emulator”.

The installation process of Wine varies from distribution to distribution. Our Today’s guide will enlist the steps to install Wine 9 (the latest Wine version) on Debian 12 Bookworm (The latest LTS of Debian).

How to Install Wine 9 on Debian 12

Wine is available on the default repositories and provides the WineHQ repository support to install Wine. However, the default repositories are not yet updated to get you to Wine 9. Thus, we will be using WineHQ’s repository to get the latest Wine 9 on Debian 12.

Step 1: Enable Multiarchitecture

First, enable support for 32bit applications (as most of the Windows applications support 32bit) on the 64bit system:

sudo dpkg --add-architecture i386

Step 2: Add WineHQ Repository’s GPG Key

The following command downloads and adds the WineHQ repository’s gpg key in the /etc/apt/keyrings directory:

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

Note: If the keyrings directory does not exist, create a keyrings directory with full access to the users, while reading and executing permissions for the group and others:

sudo mkdir -pm755 /etc/apt/keyrings

Step 3: Add WineHQ Repository

Now, download and add the WineHQ sources to Debian 12’s sources list. This adds the WineHQ Bookworm repository to your system:

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

Now, update the system packages to integrate the WineHQ’s packages in Ubuntu:

sudo apt update

Step 4: Install Wine 9

Wine is available in multiple variants; you need to get it as per your requirements. Recommended is to download/install the stable using the command:

sudo apt install --install-recommends winehq-stable

Here’s the verification:

The wine repository contains two other package versions as well:

  • Development Version: Recommended for developers only as it contains the development headers to assist developers in the process. At the time of writing, the Wine 9.1 development release is announced recently.
sudo apt install --install-recommends winehq-devel
  • Staging Version: Refer to the testing version which is recommended for users who want to test experimental patches.
sudo apt install --install-recommends winehq-staging

Bonus: Install Previous Releases of Wine

You might have some dependent programs/applications that are not yet compatible with the Wine 9. Don’t worry. You can download the version as per your requirements. Get the version table of Wine:

apt policy winehq-stable

The following command installs Wine 8.0.2: The packages winehq-stable, wine-stable, wine-stable-amd64, and wine-stable-i386 are dependent on each other. Therefore, multiple packages are required for successful execution/installation:

sudo apt install --install-recommends winehq-stable=8.0.2~bookworm-1 wine-stable=8.0.2~bookworm-1 wine-stable-amd64=8.0.2~bookworm-1 wine-stable-i386:i386=8.0.2~bookworm-1

Installing this would prioritize the newly installed Wine version. When you run the “wine –version” command, it would return 8.0.2 instead of 9.

How to Setup Wine 9 on Debian 12

Wine needs to be set up to get it ready to manage the Windows applications. You need to choose the specific Windows version and other optional settings to be mapped using Wine. Let’s do it sequentially:

How to Configure Wine

With the installation of Wine, several builtin utilties are isntalled as well. One of these is winecfg which configures Wine for your system:

winecfg

The winecfg command creates a Windows home directory, i.e., /home/username/.wine. Next, the system will prompt you to install the Wine Mono installer.

Then, select the Windows version following the path:

Applications >> Windows version >> Select Windows Version from the drop-down menu:

If you want to emulate a virtual desktop environment, you can do it: Graphics >> Select Emulate a virtual desktop >> Enter Desktop Size

Moreover, you can also configure/select the audio devices: Audio >> Defaults.

When all the possible settings are configured, Apply and OK to have the settings.

How to Install a Windows Application on Debian 12

WineHQ has a dedicated applications database where 29,276 applications are listed currently. Visit the Browse App Section to filter out the applications as per your requirements.

You can get/search for the availability of your favorite application.

Generally, Windows applications are installed either via their “.exe” or “.msi” files. Wine initiates the installer just like it is displayed on Windows normally. Let’s see how it works:

  1. Install an Executable (.exe) File

To install an executable file (exe), enter the name (with complete path) of the executable file as:

wine <exe_file>

If the Wine has read the .exe file, the possible installer window appears as in our case. You just need to follow the instructions to complete the installation.

  1. Install a Microsoft Installer (.msi) File

To install a Microsoft installer file (msi) using Wine, enter the name (with complete path) of the .msi file as per the syntax:

wine msiexec /i <msi_file>

The msi file will be launched inside the Wine desktop and the package can be installed easily:

Alternative Way of Installation

The exe and msi files can be installed via the Wine uninstaller. It is a GUI component of Wine to manage the installable/installed applications through Wine. First, launch it using the command:

wine uninstaller

When launched, do the following to install a Windows-based application.

  • 1: Click on “Install” to look for the installable file.
  • 2: Set the file types to ALL so that the .exe and .msi files are visible.
  • 3: Choose/navigate to the location where the .exe.msi files reside.
  • 4: Double-click the file that you want to install.

Soon after that, the Winrar installer will be launched.

Note: You can also install the Windows executable files from the file manager as well. Locate the executable and launch it with the “wine installer”:

How to Run a Windows Application on Debian 12

An application installed via Wine can be launched from the terminal and the applications menu. Let’s see both methods/ways:

To run an application from the terminal, use the wine keyword with the application name as follows:

wine <application_name>

Or you can launch the tool/applications from the Applications menu on Debian 12 (which would also use Wine to open/launch it).

How to Uninstall Applications via Wine

The Wine uninstaller utility allows you to modify or uninstall/remove the installed applications. First, launch it from the terminal:

wine uninstaller

Upon its launch, the list of installed applications is displayed. You have to select the one to be removed and click on Modify/Remove:

The uninstaller of that application will launch and you can remove it following the onscreen instructions:

You need to follow the onscreen instructions, if any, to complete the process.

How to Completely Uninstall/Remove Wine 9 From Debian 12

If you are no longer using Wine, you can remove it to get some space or memory. To remove the WIne from your system, use the command:

sudo apt autoremove winehq-stable --purge

Note: Similarly, if you have installed development or the staging release, you just need to replace the “winehq-stable” keyword with your release.

As it was installed using the WineHQ repository, you must remove the WineHQ repository using the command:

sudo rm /etc/apt/sources.list.d/winehq-bookworm.sources

Also, remove the respective keyring file of that repository:

sudo rm /etc/apt/keyrings/winehq-archive.key

That would remove Wine completely from your system.

Is There Any Wine GUI?

Wine officially does not offer any GUI. However, a third-party source has provided the GUI support for Wine. Its various releases are available on GitHub. It is a whole Wine manager, where you can operate Wine functionalities graphically. Let’s start with downloading:

First, navigate to the GitHub source and download the “.deb” file:

wget https://winegui.melroy.org/downloads/WineGUI-v2.3.2.deb

Now, install the WineGUI using the command:

sudo apt install ./<Deb Package File>

Launch it from the Activities or the terminal. It shows the list of installed or built-in applications. Let’s dig a bit into this GUI:

  • Complete details of the Wine version and on which Windows version the Wine is mapped.
  • GUI of several built-in applications, i.e., CMD (Command Prompt), Internet Explorer, Notepad, Task Manager, Uninstaller, Control Panel, etc.
  • Applications installed using Wine are also listed.
  • You can run any program (.exe or .msi).

Here’s the interface of WineGUI.

If you want to remove this WineGUI, use the below command:

sudo apt autoremove winegui

A screenshot of a computer program

Description automatically generated

That’s it from the installation of Wine 9 on Debian 12.

Bottom Line

Wine can be installed on Debian 12 using the Default Repositories of Debian 12 or WineHQ’s Debian repository. As discussed, the Debian repository is not yet updated for Wine 9. Thus, you can install Wine 9 from the WineHQs repository. Apart from installing Wine 9, if you want to install any previous release of Wine, you can easily do it from the WineHQs repository.

This guide has demonstrated the installation/configuration of Wine 9 on Debian 12 and also illustrated the method to install various Windows-based applications on Debian 12.

Print Friendly, PDF & Email
Categories