With the increasing popularity of Linux desktops, There is another requirement occurred that we should have an application that can be used to run Windows applications. Windows has a long list of beautiful applications for users who are not available for Linux users. As we know that Linux does not support windows executables so WineHQ is a solution to run Windows applications and Linux systems.
In this article, we have discussed two methods of Wine installation on RHEL-based Linux distributions. The first method will help you to install Wine 8.0 stable release by compiling from source code on RHEL-based systems. The second method will install Wine using the package manager from the EPEL repository. In that case, it will install wine previous version.
Method 1: Installing Wine 8.0 from Source Code
In the first method, we will download the latest version of the WineHQ source code from the official site. So let’s begin the installation:
- Installing Required Packages
Wine required many development packages. First, we recommend upgrading all system packages using the following commands.
sudo dnf clean all && sudo dnf update
Now install the required packages for Wine using the DNF package manager using the following commands.
sudo dnf groupinstall 'Development Tools'
sudo dnf install libX11-devel zlib-devel libxcb-devel libxslt-devel libgcrypt-devel libxml2-devel gnutls-devel libpng-devel libjpeg-turbo-devel libtiff-devel gstreamer-devel dbus-devel fontconfig-devel freetype-devel
- Download Wine Source Code
RPM packages for wine are not available for the latest versions, So we need to download wine source code. Use the below commands to download it.
Once the download is finished successfully, extract the archive file.
tar -Jxf wine-8.0.tar.xz -C /tmp/
- Compiling Wine from Source Code
Configure wine using one of the following commands based on your system architecture. This will set the installation environment for Wine according to your system.
- Check Wine Version
Use the following command to check the version of wine installed on your system
Method 2: Installing Wine using Package Manager
The EPEL yum repository also contains the Wine packages for installation on RHEL-based systems. You can install the Wine using the package manager without compiling it from the source code.
Follow the below steps to install Wine on RHLE-based system via package manager:
- Enable the EPEL Repository
WineHQ is not included in the default repositories of CentOS/RHEL 9/8, so we need to enable the Extra Packages for Enterprise Linux (EPEL) repository. To do this, open a terminal and run the following command:
sudo dnf install epel-release
- Install WineHQ
Now that the EPEL repository is enabled, we can install WineHQ by running the following command:
sudo yum install wine
This command will install the latest version of WineHQ available in the EPEL repository.
- Install the Windows Compatibility Layer
WineHQ is a compatibility layer that allows Windows applications to run on Linux. However, it does not come with the necessary Windows libraries to run these applications. To install the Windows Compatibility Layer, we need to run the following command:
sudo yum install wine-mono wine-gecko
- Configure WineHQ
WineHQ allows us to configure various settings to optimize the performance and compatibility of Windows applications. To access the Wine configuration window, we can run the following command:
This will open the Wine configuration window, where we can configure settings such as the Windows version, graphics, and sound.
Install Windows Application on Linux
With WineHQ and the Windows Compatibility Layer installed, we can now install Windows applications on our Linux system. To do this, we can either use the command line or the graphical user interface (GUI).
To install a Windows application using the command line, we need to run the following command:
Make sure to replace “application.exe” with the actual name of the executable file of the Windows application you want to install.
To install a Windows application using the GUI, we need to double-click on the executable file of the application. This will open the Wine configuration window, where we can select the options to install the application.
.exe File Using Wine
To use wine we need to log in to the RHEL-based desktop system. After that Download a windows executable (.exe) file like PuTTY on your system and open it with Wine as below screenshot or use the following command.
In conclusion, installing WineHQ on CentOS/RHEL 9/8 is a straightforward process that allows you to run Windows applications on your Linux system without the need for a virtual machine. With this guide, you should be able to install WineHQ, the Windows Compatibility Layer, and Windows applications on your system with ease.