How To Install WineHQ on Ubuntu 22.04

This guide intends to teach you How To Install WineHQ on Ubuntu 22.04.

Wine INot an Emulator (Wine) is a compatibility layer for Windows executable files in the Linux OS. It takes the Windows system calls and converts them to POSIX system calls readable by Linux programs.

Wine also contains a tool called “Winelib” that we use to compile Windows supported applications and programs to port them to Unix-like systems.”

In simple terms, Wine is a collection of Linux libraries that enable many Windows applications to run on Linux distributions with varying degrees of success and stability.

Steps To Install WineHQ on Ubuntu 22.04

To complete this guide, you must log in to your server as a non-root user with sudo privileges. To do this, you can follow our guide the Initial Server Setup with Ubuntu 22.04.

Enable 32-bit architecture on Ubuntu 22.04

First of all, you need to check the installed architectures. To do this, run the command below:

sudo dpkg --print-architecture

You should get the following output:

Output
amd64

Then, check if 32-bit architecture is installed on your server with the command below:

sudo dpkg --print-foreign-architectures

You should get the following output:

Output
i386

Note: If “i386” is not displayed, execute the following command:

sudo dpkg --add-architecture i386

Next, recheck again with the command below:

sudo dpkg --print-foreign-architectures

Download and Add the WineHQ Repository Key

At this point, you need to add the WineHQ repository key on Ubuntu 22.04. To do this, run the commands below:

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

Then, use the command below to download the WineHQ sources file:

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

Update your local package index:

sudo apt update

Important Note: If you get this warning W: GPG error: https://dl.winehq.org/ …, edit the winehq-<distro>.sources file and replace /usr/share/keyrings/ to /etc/apt/keyrings/.

In this case, use the command below: 

sudo sed -i s@/usr/share/keyrings/@/etc/apt/keyrings/@ /etc/apt/sources.list.d/winehq-jammy.sources

Install Wine on Ubuntu 22.04

At this point, you can use the commands below to install WineHQ on your server.

1.WineHQ Stable branch:

sudo apt install --install-recommends winehq-stable

2.WineHQ Development branch:

sudo apt install --install-recommends winehq-devel

3.WineHQ Staging branch:

sudo apt install --install-recommends winehq-staging

Note: There are no stable packages for Ubuntu 22.04 yet. Ubuntu Jammy Jellyfish did not exist when Wine 7.0 was released. There will be stable packages whenever 7.0.1 comes out. So we will install the WinHQ staging branch.

When your installation is completed, verify it by checking its version:

wine --version
Output
wine-7.6 staging

Uninstall Wine from Ubuntu 22.04

If you don’t use Wine anymore you can easily remove it from your server. To do this run the following command:

sudo apt autoremove --install-recommends winehq-staging --purge

Note: If you use Wine Development or Wine Stable, replace the winehq-stable with either winehq-devel or with winehq-stable.

For complete removal, delete the repository file:

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

If you have removed the WineHQ repository, it is recommended to remove the GPG key:

sudo rm /usr/share/keyrings/winehq*

Conclusion

At this point, you have learned to Install WineHQ on Ubuntu 22.04.

Hope you enjoy it.

You may be like these articles:

Install and Configure Fail2ban on Ubuntu 22.04

How To Install chkrootkit on Ubuntu 22.04

LEAVE A REPLY

Please enter your comment!
Please enter your name here
Captcha verification failed!
CAPTCHA user score failed. Please contact us!
Latest Articles

POPULAR TAGS

Most Popular