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.
wget https://dl.winehq.org/wine/source/8.x/wine-8.0.tar.xz
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.
cd /tmp/wine-8.0
./configure --enable-win64
make
make install
- Check Wine Version
Use the following command to check the version of wine installed on your system
wine64 --version
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:
winecfg
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:
wine application.exe
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.
Running .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.
wine ~/Downloads/putty.exe
Conclusion
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.
8 Comments
“Installing Wine using Package Manager”
This part doesn’t seem to work in Rocky Linux 9.2:
$ sudo yum install wine-mono wine-gecko
Last metadata expiration check: 0:01:41 ago on tis 13. juni 2023 14.52.12.
No match for argument: wine-mono
No match for argument: wine-gecko
Error: Unable to find a match: wine-mono wine-gecko
when I get to the verification, “win64 –version”, i get the following:
bash: wine64: command not found…
Install package ‘wine-core’ to provide command ‘wine64’? [N/y] y
* Waiting in queue…
* Loading list of packages…. Failed to install packages: Could not depsolve transaction; 1 problem detected: Problem: conflicting requests
– nothing provided SDL2(x86-64) needed by wine-core-4.0.4-1.el8.x86_64
Hi Rahul,
How can I uninstall it ? I accidentally installed it as root.
thank you
Hello admin. I received an error when running them.
The command: DNF install libX11-devel freetype-devel …
when run is throws error fontconfig-devel so I changed command to two-line command.
1. dnf install libX11-devel freetype-devel zlib-devel libxcb-devel libxslt-devel libgcrypt-devel libxml2-devel gnutls-devel libpng-devel libjpeg-turbo-devel libtiff-devel gstreamer-devel dbus-devel
2. dnf install freetype-devel.
Then it working for me.
What happened.
It’s gstreamer1-devel !
Thank you!
THANK YOU !!