thelinuxvault blog

Install Wine on Ubuntu 20.04 Focal Fossa Linux

If you’re an Ubuntu 20.04 user who needs to run Windows applications, Wine is your go-to tool. Wine (recursively short for Wine Is Not an Emulator) is a free, open-source compatibility layer that allows Linux, macOS, and BSD systems to run Windows applications without requiring a Windows license or virtual machine.

Unlike emulators, which mimic hardware, Wine translates Windows API calls into native Linux system calls, enabling near-native performance for many applications. From productivity tools like Microsoft Office to games and utilities, Wine supports thousands of Windows apps (check compatibility on the Wine AppDB).

In this guide, we’ll walk through installing Wine on Ubuntu 20.04 Focal Fossa, configuring it, and installing a Windows application—step by step.

2026-02

Table of Contents#

Prerequisites#

Before starting, ensure you have:

  • Ubuntu 20.04 LTS (Focal Fossa) installed (64-bit recommended).
  • sudo privileges: You’ll need administrative access to install packages.
  • Internet connection: To download Wine and dependencies.

Installing Wine on Ubuntu 20.04#

Wine is not included in Ubuntu’s default repositories (or is outdated there). For the latest stable version, we’ll use the official WineHQ repository. Follow these steps:

Step 1: Update System Packages#

First, update your system’s package list and upgrade existing packages to avoid conflicts:

sudo apt update && sudo apt upgrade -y

This ensures your system has the latest security patches and dependencies.

Step 2: Enable 32-bit Architecture#

Many Windows applications are 32-bit, so we need to enable 32-bit support on your 64-bit Ubuntu system. Run:

sudo dpkg --add-architecture i386

If you see an error like dpkg: error: unable to process architecture i386, your system may be 32-bit (rare for modern Ubuntu). Skip this step if you’re on a 32-bit system.

Step 3: Add the WineHQ Repository#

WineHQ provides official repositories for Ubuntu. To add it:

a. Install wget (if missing)#

wget is required to download the WineHQ GPG key. Install it with:

sudo apt install -y wget

b. Import the WineHQ GPG Key#

GPG keys verify the authenticity of packages. Import WineHQ’s key:

wget -qO - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -

If you get an error like apt-key is deprecated, use gpg instead (Ubuntu 20.04 still supports apt-key, but for future-proofing):

wget -qO - https://dl.winehq.org/wine-builds/winehq.key | gpg --dearmor | sudo tee /usr/share/keyrings/winehq-archive-keyring.gpg > /dev/null

c. Add the WineHQ Repository#

Add the repository for Ubuntu 20.04 (codename focal):

sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main'

If you used the gpg --dearmor method earlier, use this command instead to reference the keyring:

echo "deb [signed-by=/usr/share/keyrings/winehq-archive-keyring.gpg] https://dl.winehq.org/wine-builds/ubuntu/ focal main" | sudo tee /etc/apt/sources.list.d/winehq.list > /dev/null

Step 4: Install Wine#

Now update the package list again to include the WineHQ repository:

sudo apt update

Install the stable version of Wine (recommended for most users). Run:

sudo apt install --install-recommends winehq-stable -y
  • --install-recommends ensures optional dependencies (e.g., fonts, codecs) are installed, improving app compatibility.

Alternative Versions:

  • For bleeding-edge features (unstable), install winehq-devel.
  • For long-term support (older but stable), install winehq-staging.

Step 5: Verify Installation#

Check if Wine installed correctly by running:

wine --version

You should see output like:

wine-8.0.2 (or similar version)

If you get a "command not found" error, the installation failed. Check the previous steps for typos.

Configuring Wine#

After installation, configure Wine to set up the Windows environment (e.g., default Windows version, graphics, sound).

Run winecfg#

Launch the Wine configuration tool:

winecfg

This will:

  1. Create a hidden .wine directory in your home folder (~/.wine), which acts as the "C: drive" for Windows apps.
  2. Open a GUI window with configuration options.

Key Settings in winecfg:#

  • Windows Version: Choose a Windows version (e.g., Windows 10) from the dropdown. Most apps work with Windows 10.
  • Graphics: Adjust screen resolution or enable "Emulate a virtual desktop" for apps that misbehave.
  • Audio: Ensure your sound driver is selected (usually "PulseAudio" for Ubuntu).
  • Libraries: Override specific Windows DLLs if an app requires older versions (advanced).

Click "OK" to save changes.

Installing Windows Applications with Wine#

Let’s install a sample app—Notepad++ (a popular text editor)—to test Wine.

Step 1: Download the Windows Installer#

Go to the Notepad++ website and download the 64-bit or 32-bit .exe installer (e.g., npp.8.5.4.Installer.exe).

Step 2: Run the Installer with Wine#

Navigate to your Downloads folder and run the installer:

cd ~/Downloads
wine npp.8.5.4.Installer.exe

A Windows-style installer window will open. Follow the prompts (accept the license, choose install location, etc.).

Step 3: Launch the App#

Once installed, launch Notepad++ from the terminal:

wine ~/.wine/drive_c/Program\ Files/Notepad++/notepad++.exe

Or, for easier access, create a desktop shortcut:

  • Right-click your desktop → "Create Launcher".
  • Name: Notepad++
  • Command: wine ~/.wine/drive_c/Program\ Files/Notepad++/notepad++.exe
  • Icon: Download a Notepad++ icon (e.g., from Icons8) and select it.

Uninstalling Wine (Optional)#

If you no longer need Wine, remove it and its dependencies:

Step 1: Uninstall Wine#

sudo apt remove --purge winehq-stable -y

Replace winehq-stable with winehq-devel or winehq-staging if you installed those versions.

Step 2: Remove Dependencies#

Clean up unused packages:

sudo apt autoremove -y && sudo apt autoclean

Step 3: Delete Wine Configuration#

Remove the .wine directory (deletes all installed Windows apps):

rm -rf ~/.wine

Step 4: Remove the WineHQ Repository (Optional)#

Delete the repository file:

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

And the GPG key (if you used apt-key):

sudo apt-key del F987672F

Troubleshooting Common Issues#

1. "Wine: could not find Wine Gecko"#

Wine requires Gecko (a web rendering engine) for HTML support in installers. When prompted, click "Install" to download it automatically. If the prompt fails, install it manually:

sudo apt install wine-gecko -y

2. "Wine: could not find Wine Mono"#

Mono is required for .NET applications. Install it:

sudo apt install wine-mono -y

3. App Crashes or Doesn’t Launch#

Check the Wine AppDB for your app—users often share fixes. Common solutions:

  • Use winetricks to install missing libraries (e.g., winetricks dotnet45 for .NET 4.5).
  • Change the Windows version in winecfg (try Windows 7/8 for older apps).
  • Run the app in a terminal to see error logs: wine path/to/app.exe (look for "err:" messages).

4. 32-bit App Issues#

Ensure 32-bit architecture is enabled (sudo dpkg --add-architecture i386) and reinstall Wine with 32-bit support:

sudo apt install --install-recommends winehq-stable:i386 -y

Conclusion#

With Wine installed on Ubuntu 20.04, you can now run many Windows applications seamlessly. While not all apps work perfectly (check the AppDB for compatibility), Wine is constantly improving.

Whether you need to use Microsoft Office, Adobe Acrobat, or legacy utilities, Wine eliminates the need for a dual-boot or virtual machine. Experiment with different apps, and don’t hesitate to use winetricks or the Wine community forums for help!

References#