Install Wine 9 on Linux and run Windows apps

Install Wine on Ubuntu22.04Desktop. Refer to the Ubuntu WineHQ Repository on the official page to install by repository.

https://www.winehq.org/

The sudo dpkg --add-architecture i386 command is used to add support for 32-bit libraries and applications in Debian-like Linux distributions (such as Ubuntu). This command allows the system to recognize and install 32-bit packages. If you do not need a particular 32-bit software or library, you do not need to run this command. However, if you plan to use a gaming platform such as Steam or certain older software, it is recommended that you enable 32-bit architecture.

If you are using a 64-bit system, whether or not you need to enable 32-bit architecture depends on the work you want to do and the software you want to install. In many cases, 64-bit systems also support 32-bit applications, but some older software and libraries are 32-bit-only, in which case you will need to enable 32-bit architecture. We will not install them here.

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

These commands are used as part of setting up a repository for software called Wine, a program that allows Windows applications to run on Linux and other UNIX-like operating systems.

  1. The sudo mkdir -pm755 /etc/apt/keyrings command creates a new directory on the system. This directory will later be used as a place to store keys for the Wine repository.- pm755 is an option to set specific permissions on the directory to be created.
  2. sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key This command downloads the key for the official Wine repository from the Internet, stored in the /etc/apt/keyrings directory you created earlier. This key is used to verify that the repository is trustworthy.

These commands are usually followed by commands to add the Wine repository to the system’s repository list.

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

The above command adds Wine repository information to the /etc/apt/sources.list.d/ directory. This will register the Wine repository for Ubuntu 22.04 with the system.

  1. After these steps, run sudo apt update to update the list of repositories.
  2. Finally, install Wine with sudo apt install winehq-stable (or another version).

One of the first common steps after installing Wine is to run the winecfg command. winecfg is Wine’s configuration tool and is used to customize the Wine environment.

Running winecfg opens the Wine configuration window. Here, you can configure the following settings

  • Windows version selection: different Windows applications may work best on different versions of Windows, so you can adjust this setting.
  • Drive mapping: Sets the mapping between the Linux file system and Wine’s virtual Windows drive.
  • Graphics Settings: Allows you to adjust options related to graphical display, such as screen resolution and DPI settings.
  • Audio settings: configure audio drivers and output devices.

winecfg is important for properly configuring the Wine environment, especially if you have newly installed Wine or before running certain Windows programs. In most cases, however, many applications will run fine with Wine’s default settings. For more complex settings and specific application behavior, it is useful to consult the official Wine documentation and community forums.

If you see the Wine Mono installer, we recommend that you install it; Wine Mono is an open source implementation of Microsoft’s .NET Framework, and since many Windows-based applications NET Framework, and is important for improving the compatibility and functionality of applications with Wine because it requires it.

Wine Mono serves the following roles

  • Support for applications that depend on the .NET Framework: Certain applications and games run on the .NET Framework and may not work properly without Wine Mono.
  • Improved compatibility: Installing Wine Mono improves the compatibility of various Windows applications and makes them run smoothly in a Linux environment.

The Wine Mono installer automatically pops up because Wine has detected that the required .NET Framework components are not yet installed. Using this installer to install Wine Mono will provide these components and allow more applications to run properly on Wine.

Therefore, when the Wine Mono installer appears, it is recommended that you follow its instructions to proceed with the installation. This will greatly enhance the functionality of the Wine environment.

For myself, when the Wine Mono installer was displayed, I cancelled it and the winecfg command did not show up after the second time. if the Wine Mono installer does not show up anymore, there is a way to manually install Wine Mono. Follow these steps

The Wine .wine directory contains the virtual Windows environment used by Wine. If you delete this directory, Wine may create a new environment and ask you to install the necessary components. You should now see the Wine Mono installer again. In Ubuntu Desktop, this directory is located in Home, but it is a hidden file (directory), so view it and then delete it In Ubuntu Desktop, this directory is located at home, but it is a hidden file (directory). You can also delete it in the terminal.

Please share if you like it!
TOC