Installing Wine on Linux
How to Install Wine on Debian 11 Bullseye
Contents
Appendix 2: Disable CDROM repositories
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-architecture
See if 32-bit architecture is already installed. The following command should respond with “i386”
$ dpkg –print-foreign-architectures
If it does not display “i386”, execute the following.
$ sudo dpkg –add-architecture i386
Re-check with
$ dpkg –print-foreign-architectures
Download 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.key
Add the Wine repository
$ sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bullseye/winehq-bullseye.sources
Update the package database
$ sudo apt update
Install 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-stable
Verify the installation succeeded.
$ wine –version
Configure Wine
The default Wine configuration prepares Wine as a Windows 7 environment, which is good for some older Windows apps, but many contemporary apps will be better matched to Windows 8.1 or Windows 10. In addition, other configuration options may be significant.
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.
$ wine winecfg
If 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
Run Wine’s builtin web browser
If installing gecko is offered, accept the offer.
Lately, iexplore fails to run properly on some distributions. If the window that opens is solid black, click the Refresh button to obtain partial functionality. Scrolling does not work, but links and window resizing do.
$ wine iexplore
Appendix 1: Enable sudo
This appendix explains how to install sudo and grant yourself sudo privileges. To do these, you must know the root password.
Open a terminal window and issue the following command.
$ sudo echo Hello
If, after accepting your password, Hello is displayed, sudo is installed and you are authorized to use sudo, so there is nothing to do. Otherwise, continue with the following.
Login as superuser.
$ su -l
If your attempt to use sudo failed with a “sudo not found” message, use the next two commands to install sudo, but skip them if sudo is already installed.
# apt update
# apt install sudo
With sudo installed, the following enables you to use sudo. Just replace your-user-name by your own user name.
# adduser your-user-name sudo
Log out of the root account and close the Terminal window.
# exit
$ exit
Close any open apps.
In order to activate sudo for your user name, Restart your Computer.
When logged in again, continue from here to verify sudo is installed and properly configured.
——– Waiting for computer to restart ——–
To verify you can now use sudo, open a Terminal session and issue the following command.
$ sudo echo Hello
The test is successful if, after requesting and receiving your password, Hello is displayed.
Appendix 2: Disable CDROM repositories
If you installed Debian from a disk or USB drive, your installation may have registered a CDROM drive as a repository, and, if the installation disk is not present in the CDROM drive, any attempt to update or upgrade Debian will fail with an error message referencing the CDROM repository. One way to fix this is to load the installation disk into the CDROM drive prior to update or upgrade.
If you do not have a disk (perhaps because you installed from a USB drive), or if you do not want the inconvenience of loading a disk, you can disable the CDROM repository, as described in this appendix.
- Locate and open Software & Updates.
- Click the Other Software tab.
- Remove any check mark from cdrom:… entries.
- Enter the appropriate password.
- Click the Close button.
- A window with the title “The information about available software is out-of-date” will open. Click the Reload button.
- Wait for the update to complete.