
How to Install Wine 6 on Ubuntu 20.04: A Step-by-Step Guide
Ever wished you could run your favorite Windows application or game directly on your Ubuntu 20.04 system? While Linux offers a massive ecosystem of native software, some essential Windows-only programs can be hard to replace. This is where Wine comes in.
Wine (a recursive acronym for “Wine Is Not an Emulator”) is a powerful compatibility layer that allows you to run Windows applications seamlessly on Linux and other POSIX-compliant operating systems. Instead of simulating an entire Windows OS, it translates Windows API calls into POSIX calls on the fly, offering better performance and integration.
This comprehensive guide will walk you through the process of installing the official Wine 6 (Stable) release on Ubuntu 20.04 (Focal Fossa) using the recommended WineHQ repository. Following these steps ensures you get the latest stable version with optimal compatibility.
Prerequisites
Before we begin, ensure you have the following:
- A system running Ubuntu 20.04.
- Access to the terminal.
- A user account with
sudo
privileges.
Step 1: Enable 32-bit Architecture
Many Windows applications are still 32-bit. To ensure maximum compatibility, the first step is to enable the 32-bit architecture on your 64-bit Ubuntu system.
Open your terminal and execute the following command:
sudo dpkg --add-architecture i386
This command modifies the package manager to recognize and install 32-bit libraries, which are crucial for Wine to function correctly.
Step 2: Add the Official WineHQ Repository Key
To ensure the packages you download are authentic, you need to add the official WineHQ repository signing key. This key verifies that the software you’re about to install comes from a trusted source.
Download and add the key with this command:
wget -nc https://dl.winehq.org/wine-builds/winehq.key
sudo apt-key add winehq.key
You should see an “OK” message in the terminal, confirming the key was successfully added.
Step 3: Add the WineHQ Repository
With the key in place, you can now add the official Wine repository to your system’s software sources. This tells your package manager where to find the latest Wine packages.
Run the following command to add the repository for Ubuntu 20.04:
sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main'
After adding the repository, it’s essential to update your system’s package list to include the new packages from WineHQ:
sudo apt update
Step 4: Install Wine 6 on Ubuntu 20.04
Now you are ready to install Wine. The WineHQ repository offers a few different versions. For most users, the stable branch is the recommended choice as it offers the best reliability.
To install the stable version of Wine 6, use this command:
sudo apt install --install-recommends winehq-stable
The --install-recommends
flag ensures that all the necessary libraries and dependencies for common applications are installed alongside Wine, preventing potential issues down the line. The package manager will show you a list of new packages to be installed; press Y
and Enter to proceed.
Other Wine Versions (Optional)
- Development Branch: For the latest features, but potentially less stable:
sudo apt install --install-recommends winehq-devel
- Staging Branch: Contains experimental patches and is for advanced users:
sudo apt install --install-recommends winehq-staging
Step 5: Verify the Installation
Once the installation is complete, you can verify that Wine has been installed correctly by checking its version.
wine --version
The output should show the version you installed, for example: wine-6.0.3
.
Step 6: Configure Wine
The first time you run a Wine command, it will automatically create a configuration directory (usually at ~/.wine
). You can initialize this process manually by running the Wine configuration tool.
winecfg
When you run this for the first time, a dialog box will appear prompting you to install wine-mono
and wine-gecko
packages. These are essential components that provide support for .NET and HTML-based applications. It is highly recommended that you click “Install” for both when prompted.
After the components are installed, the Wine Configuration window will appear. Here, you can adjust settings like the Windows version to emulate, graphics drivers, and audio settings. For now, the default settings are usually fine.
How to Use Wine to Run a Windows Application
Running a Windows executable (.exe
, .msi
) is straightforward. Navigate to the directory containing the file in your terminal and use the wine
command.
For example, to run an installer named setup.exe
, you would use:
wine setup.exe
You can also simply double-click an .exe
file from your file manager, and Ubuntu should offer to open it with the “Wine Windows Program Loader.”
A Crucial Security Note
Remember that Wine is a compatibility layer, not a security sandbox. A Windows virus or malware can run through Wine and may have the ability to access your personal files. As a best practice, only run applications from trusted and legitimate sources. Avoid downloading and executing random .exe
files from the internet.
With Wine 6 successfully installed, you have unlocked the ability to run a vast library of Windows software on your Ubuntu 20.04 desktop, bridging the gap between two powerful operating systems.
Source: https://kifarunix.com/install-wine-6-on-ubuntu/