How to Install Wine in Ubuntu 22.04 to Install & Run Windows Apps

To run Microsoft Windows applications in Ubuntu Linux, Wine or CrossOver (paid version) is a good choice. And here’s how to install and use Wine in Ubuntu 22.04 LTS.

In this tutorial, you’ll see 2 ways to install Wine in Ubuntu. Choose either one that you prefer.

Install Wine from Ubuntu repository:

Ubuntu included Wine package in its own repository, though it’s old. User may simply press Ctrl+Alt+T on keyboard to open terminal and run command to install it:

sudo dpkg --add-architecture i386 && sudo apt install wine

Type user password (no asterisk feedback) and hit Enter to authentication for sudo.

After installed package run winecfg in terminal to generate configuration file. And, run command to make link the .desktop file:

sudo ln -s /usr/share/doc/wine/examples/wine.desktop /usr/share/applications/

Finally, you may right-click on an EXE file to run via “Wine Windows Program Loader” option:

Install Wine from its official repository:

The Wine developer team provides an official apt repository for Debian/Ubuntu based systems. By releasing v7.6, it added Ubuntu 22.04 support.

1. Install Wine key

The repository now has updated with new method to install the key to follow Debian policy, as apt-key is deprecated. However, it’s still ASCII-armored key so far.

Press Ctrl+Alt+T on keyboard to open terminal. When it opens, create the directory for storing the keys:

sudo mkdir -p /etc/apt/keyrings

Then, run the single command to download the key, dearmor, and move to “/etc/apt/keyrings” directory:

wget -O - https://dl.winehq.org/wine-builds/winehq.key | gpg --dearmor | sudo tee /etc/apt/keyrings/winehq-archive.key

Type user password and hit Enter if the command stuck with blinking cursor. And, it will output un-readable text as the picture shows:

2. Add Wine repository:

Next run the commands below one by one to download the repository setup file and move to “/etc/apt/sources.list.d” directory.

  • Download the source file:
    wget -nc https://dl.winehq.org/wine-builds/ubuntu/dists/$(lsb_release -sc)/winehq-$(lsb_release -sc).sources
  • Move it into “/etc/apt/sources.list.d”:
    sudo mv winehq-$(lsb_release -sc).sources /etc/apt/sources.list.d/

NOTE: This command is for Ubuntu only. “$(lsb_release -sc)” returns system’s code-name. For Linux Mint and other Ubuntu based system, replace it with jammy (22.04), focal (20.04) or bionic (18.04) depends on which Ubuntu edition your system is based on.

3. Update cache

Before installing any package from that repository, you need to refresh system cache by running command in terminal:

sudo apt update

4. Install Wine:

The Wine repository provides three Wine packages:

  • winehq-stable – the stable version (v8.0 so far)
  • winehq-devel – the latest development release.
  • winehq-staging – the testing version with patches applied on top of the corresponding wine-devel

Select install one of the packages by running command below in terminal:

  • To install the stable edition use command:
    sudo apt install winehq-stable
  • Install wine development release via:
    sudo apt install winehq-devel
  • Or install wine-staging via command:
    sudo apt install winehq-staging

NOTE: It does not re-build old packages for new Linux systems. winehq-stable so far is not available for Ubuntu 22.04, since the new LTS is released after wine stable 7.0. User may wait for the next stable release (v7.0.1 or v8.0).

After installation, right-click on your EXE file and start it via Wine program loader option. See if your app works with wine.

How to Remove Wine:

1. To remove the Wine package, simply open terminal and run commands:

sudo apt remove wine winehq-stable winehq-staging winehq-devel

There will be local configuration files and app data left under .wine and .local/share/applications. They are hidden folders, press Ctrl+H in file manager to toggle display and remove them as you want.

2. To remove the Wine repository, open terminal (Ctrl+Alt+T) and run command:

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

And remove the repository key via command:

sudo rm /etc/apt/keyrings/winehq-archive.key

Finally apply changes by running sudo apt update to refresh system package cache.

Published
Categorized as Howtos Tagged

By Ji m

I'm a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to remind me outdated tutorial! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via ubuntuhandbook1@gmail.com Buy me a coffee: https://ko-fi.com/ubuntuhandbook1

11 comments

  1. I have followed the steps above in Ubuntu 22.04 to install wine.
    It does not open but gives me an error message….
    Couldn’t load XPCOM.

    What do I do next?

  2. Well I followed the second option and it was so cool and easy. I’m currently using Linux Lite 6.4 (Ubuntu Based distro).
    Thank you very much, won’t be stressing myself so much the next time I will be installing winehq.

  3. Your command:

    wget -nc https://dl.winehq.org/wine-builds/ubuntu/dists/$(lsb_release -sc)/winehq-$(lsb_release -sc).sources

    does NOT work andproduces this message:

    zsh: parse error near `)’

    The correct command WORKS OK for Ubuntu 22.04 LTS:

    wget -nc https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources

    You should see something like this:

    Resolving dl.winehq.org (dl.winehq.org)… 146.75.94.217
    Connecting to dl.winehq.org (dl.winehq.org)|146.75.94.217|:443… connected.
    HTTP request sent, awaiting response… 200 OK
    Length: 163
    Saving to: ‘winehq-jammy.sources’

    winehq-jammy. 100% 163 –.-KB/s in 0s

    2023-04-15 11:26:25 (9.73 MB/s) – ‘winehq-jammy.sources’ saved [163/163]

  4. I installed WINE via the first method. Seemed to go fine. But when I get to the step about trying to run an executable file, WINE is nowhere to be found in any of my menus. I assumed the command before that step was meant to create a desktop icon, but it didn’t. Rebooted the machine and still nothing. Wine is installed on the system – I checked via two methods. But no idea how to launch it. Apparently from command line I can enter “wine” and then the name of a program, but I don’t have a program, i have an .exe file in my downloads folder that I want to run. Any idea where I can find Wine or why it’s not showing up?

    1. Did you try to generate config file via command:

      winecfg

      Also, create the shortcut by linking the example file:

      sudo ln -s /usr/share/doc/wine/examples/wine.desktop /usr/share/applications/

      This worked in my case in Ubuntu 22.04.

      1. Yes, I did both those things.

        I’ve decided to give up on WINE and try VirtualBox instead as it seems like WINE is pretty consistently riddled with problems. I’m not the only one who has this install issue and there don’t seem to be any easy fixes.

        Thanks anyway.

  5. apt-get check` failed, you may have broken packages. Aborting…
    Got all the way only to get this at the end. Any ideas?
    Ubuntu 22.04.2 LTS fully updated.

    1. Could you please paste the error output here, from terminal window. So we can tell what was going wrong.

  6. There is no error. What I am seeing is that my version of the iso file does not include the partition table you show in your installation guide (even though my copy came from the “Official Ubuntu” site.) Do you have a recommended site to download the iso file from (My experience with PhoenixNAP was that is is VERY slow).
    Thank you

    1. Ubuntu has download mirrors, just choose one near to you:

      https://launchpad.net/ubuntu/+cdmirrors

      For the ‘partition table’, if you meant the Ubuntu 22.04 installation guide. Then it could be something to do your disk. If it’s a brand new HDD or SSD, then the Ubuntu installer wizard should have a “New Partition Table” there to create it.

  7. This guide worked for me after I had an wine-staging installation working, and the I deleted the .wine folder inside my Home folder and couldn’t get any wine installation to work after installing wine-staging again after the .wine folder delete mishap.

    Followed the guide to completely remove my former wine-staging installation, the re-started my wine installation on my Linux Mint 21.2 system.

    Just had to alter the guide information with this line..

    wget -nc https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources

    instead of the line in this guide…

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Exit mobile version