Tech · Note
Setting up wine on debian 11 / chrome linux
Installing Wine
If you find you cannot use sudo, or if you get error messages referring to a CDROM repository, see Appendix 1 or Appendix 2.
Check installed architectures
Verify 64-bit architecture. The following command should respond with “amd64”.
dpkg --print-architectureSee if 32-bit architecture is already installed. The following command should respond with “i386”
dpkg --print-foreign-architecturesIf it does not display “i386”, execute the following.
sudo dpkg --add-architecture i386Re-check with
dpkg --print-foreign-architecturesDownload and add the WineHQ repository key
sudo mkdir -pm755 /etc/apt/keyrings
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.keyAdd the Wine repository
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bullseye/winehq-bullseye.sourcesUpdate the package database
sudo apt updateInstall Wine
The next command installs Wine Stable. To install Wine Development or Wine Staging, replace winehq-stable by winehq-devel or winehq-staging
After a major Wine upgrade (from Wine 6 to Wine 7, for example), Wine Stable may temporarily be unavailable, but Wine Development and Wine Staging can still be installed.
sudo apt install --install-recommends winehq-stableVerify the installation succeeded.
$ wine --versionConfigure Wine
To bring up Wine’s configuration panel, open a Terminal window and execute winecfg. If installing mono or gecko is offered, accept the offer.
When prompted, set your preferred version of Windows. Windows 10 may be preferred for most applications.
wine winecfgIf you are creating custom Wine prefixes, this configuration must be repeated for each prefix.
Two simple tests
Just for fun, or to see Wine in action …
Display a simple clock
$ wine clock
How to install a Windows app
Wine is a Terminal application. Even after installing Wine, you will not find it listed with the desktop apps that came with your Linux distribution. Wine is invoked using Terminal commands.
As an example of using Wine, here is how to install WinPgm, a fictitious windows application. You can use the same procedure to install your own Windows apps by replacing the installer for WinPgm with your app’s installer.
The first step is to download the WinPgm installer and store it in ~/Downloads.
After doing that, execute winecfg (if you haven’t already).
wine winecfg
The command to install WinPgm must be issued from within the same directory as the installer, so execute
$ cd ~/Downloads
The next command starts the installation. Respond to the installer’s prompts just as you would in Windows.
wine WinPgm-installer.exeWhen installation is complete, look for a WinPgm launcher on your desktop. There may also be an entry named Wine in your distribution’s Applications. Launchers may require you to confirm execution of your app is safe.
More about installing Windows apps
- The installer does not need to be in ~/Downloads. Any directory is fine, as long as you issue the wine command from that directory.
- If the installer is a Windows .msi file instead of an .exe, use the
wine msiexec /icommand instead of wine. - Not all Windows apps can run under Wine. Consulting the Wine Application Database may be helpful.
- For more information, search for online tutorials on using Wine. One that includes basic information plus some advanced techniques is Installing Windows Apps on Linux