How to install Wine on Ubuntu 22.04

Endrit Qerreti

Endrit Qerreti

Wine is an open source app, that allows you to run Windows apps on Ubuntu, and other linux distros.

With wine you can run your favorite Windows software on your Ubuntu machine.

Wine can be installed on Ubuntu easily from the terminal.

Wine is very useful app, and necessary to use when the app that you use daily or use for work, it's not supported on Ubuntu. So the only way to be able to use this app on Ubuntu, is by using wine.

In this tutorial, you will learn how to install Wine on Ubuntu 22.04.

Install Wine on Ubuntu 22.04

Step 1 - Enable 32 bit architecture

Some apps support only 32bit systems, which means if you are using a 64bit system, then you will need to enable the 32bit architecture in order to run those apps.

To do so, run the command below

sudo dpkg --add-architecture i386 

Step 2 - Add Wine Key

Next, proceed to add Wine Key on your system. Run the commands below to do so.

sudo mkdir -pm755 /etc/apt/keyrings
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key

The commands above will create and setup the correct permission for the directory keyring, this is the directory where wine key will be downloaded and stored.

Once you add wine key, proceed to next step.

Step 3 - Add Wine Repository

Next, you need to add Wine repository on your Ubuntu machine. To add Wine repository, you can do so by running the command below.

sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources

The command above will download Wine repository information, and add it on the repository directory, which is located at /etc/apt/sources.list.d

The wine repository file is called winehq-jammy.source

Step 4 - Update Ubuntu packages

Now that Wine repository has been added on your machine, to make this repository active, you must update your repository database.

sudo apt update

Updating, will make wine repository active, and then you should be able to use it download Wine.

Step 5 - Install Wine

Wine can now be installed on your Ubuntu machine.

To do so, run the command below.

sudo apt install --install-recommends winehq-stable

Uninstall Wine on Ubuntu 22.04

To uninstall Wine, you need to remove the package that you downloaded winehq-stable

sudo apt remove winehq-stable

Conclusion

By now you should know how to install and uninstall Wine on Ubuntu 22.04.

You should also be able to run Windows applications on your Ubuntu 22.04 machine.