In this article, we will examine how to set up and use Wine 7.0 to use programs or games running on Windows on a desktop or laptop computer running Kali Linux 2022 (2022.3) operating system.
How to Set Up Wine 7.0 to Run Windows Apps on Kali Linux 2022.3
When installing an application on a Windows-based PC, the setup file extension is usually EXE or MSI. These file extensions do not work on Linux systems for compatibility reasons. But you can try to install a widely used application such as Office or Photoshop on all Linux distributions via Wine.
Wine software is a layer developed by WineHQ that allows you to run Windows-compatible applications or games on a Linux system. You can run and use the software in the WineHQ database on your Linux computer.
Some incompatibility errors may occur when new versions of Wine software are released or when you update your Linux system. Before starting the installation of any program, we recommend that you back up your computer due to such problems.
In order to run WineHQ on your Kali Linux system, you must first download some necessary files from the website and copy them to the required locations. Also, if you are going to install a 32 Bit program instead of 64 Bit, you need to enable 32 Bit architecture in order to run these applications smoothly.
In your Kali system, open the terminal by pressing CTRL + ALT + T together and activate the 32 Bit architecture first and then download the WineHQ.key file and add it to /usr/share/keyrings/winehq-archive.key.
Since Kali distribution is based on Debian, you need to add winehq-bullseye.sources to your system. First, download the sources file to your computer via the wget command, and then add it to /etc/apt/sources.list.d/.
After downloading winehq.key and sources and adding them to your system, we recommend that you add the Debian repository address so that some packages can be installed without problems.
To add the Debian Bullseye source to the Kali repository list, execute the below command in the terminal and then the “sudo apt update” command to check for new versions of available packages based on your system’s repository addresses.
echo "deb http://ftp.us.debian.org/debian bullseye main " | sudo tee -a /etc/apt/sources.list
sudo apt update
After refreshing the repository addresses, execute the “sudo apt install –install-recommends winehq-stable” command in the terminal to install the stable version of the Wine software.
If you are getting the error below in the terminal at this stage, you need to install some additional packages manually. Otherwise, you will not be able to install the stable version of the Wine program.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
winehq-stable : Depends: wine-stable (= 126.96.36.199~bullseye-1)
E: Unable to correct problems, you have held broken packages.
To resolve the Unmet dependencies error, execute the command below in the terminal and confirm the installation of packages with a size of about 500 MB, and after installing the packages, run the WineHQ-Stable command again.
When you try to install WineHQ again, this time you will be able to see the new packages to be installed. After checking the packages to be installed, press Y and Enter to confirm.
After installing WineHQ, you can use “wine –version” and “winecfg” commands in the terminal to check its version and run it. When you run Wine, click the Install button in the Mono Installer window for the NET Framework applications to run smoothly.
When Wine Configuration opens, you can check the version from the About section and change or configure the installation location of the programs from the Applications section.
How to Install a Windows Application
After installing Wine on Kali Linux, the first thing you need to do is to download a commonly used Windows software and start using it on your Linux computer.
To download LightShot, a great screenshot program widely used in Windows and macOS systems, and install it on your Linux computer, execute the commands below in the order in the terminal.
After starting the setup-lightshot.exe setup with Wine, the wizard will open just like in Windows systems. Select the language you want to use LightShot in and click OK.
After reading the license terms of the LightShot program, accept it and click Next.
After installing LightShot on your Kali Linux system, click the Finish button to close the installation wizard.
When the LightShot program opens, you will see it running in the taskbar. By clicking on the program, you can open the screenshot capture area and save the image of the area you want.
Save the area you took the screenshot of on the desktop or any location, and after right-clicking on it, you can open the image you saved by clicking “Open With Ristretto Image Viewer” from the options that appear.
How to Uninstall Wine
If you don’t want to use Windows-compatible software on your Kali computer anymore, you can easily uninstall WineHQ software via the terminal to increase disk space and free your system from unnecessary software.
To uninstall Wine, execute the “sudo apt remove wine* -y” command in the terminal and wait for the uninstall process to complete.
sudo apt remove wine* -y
After removing WineHQ from your system, execute the command “sudo apt autoremove -y && sudo apt autoclean -y” to clean unnecessary packages as well.
sudo apt autoremove -y && sudo apt autoclean -y
Finally, execute the commands below in the terminal to delete the sources and key files that Wine has defined for your system from the relevant locations. When you run the “wine –version” command again to verify the uninstallation, you can see that it has completely deleted the software.