How to install Wine on Ubuntu 22.04

WINE  is a compatibility layer for running Windows applications on Unix-like operating systems, such as Linux, macOS, and BSD. WINE works by providing a set of libraries that allow Windows applications to run natively on non-Windows systems.

By using WINE, you can install and run many Windows applications directly on your non-Windows server from AlphaVPS without requiring a Windows installation.

This tutorial will show you how to successfully install it on your Ubuntu 22.04 server from AlphaVPS.

A pre-requisite to this guide is a working GUI with remote access /preferably/.
You can refer to our GUI + RDP guide here.


Enable 32-bit architecture

Wine requires a 32-bit architecture for your system.
You can do so by running:

sudo dpkg --add-architecture i386 


Add the repository

To install the latest version of Wine, WineHQ has its own Ubuntu repository.
We can add it with the following commands:

sudo mkdir -pm755 /etc/apt/keyrings
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources
sudo apt update

Installation

Once the repository is added, the installation is quite simple.
You only need to run the following line:

sudo apt install --install-recommends winehq-stable

You can confirm the installation by running wine --version.
You will receive a similar output:

wine-8.0.1