Installing Wine32 on a 64bits Debian/Ubuntu Linux

A little tutorial for people willing to install Wine32 on a 64 bits Debian based Linux distribution.

TLDR (i.e short version)

As root type the following commands:

# dpkg --add-architecture i386
# apt update
# apt install wine32

Long version

When installing a 64 bits Debian based distribution on a 64 bits Intel/AMD computer, you end up with apt (the Debian package manager) configured to install only 64 bits packages on your system; which makes sense in most cases.

To know whether you are running a 32bits or a 64bits OS, run the following command (x86_64 mean 64bits):

$ lscpu  | grep Architecture
Architecture:                    x86_64

Now we will need to perform of few commands as root, so let's switch to a root session:

$ sudo -i
[sudo] password for <your-username>:

Let's update the apt cache, look at what packages starting with wine we have:

# apt update && apt list "wine*"
Hit:1 http://deb.debian.org/debian bullseye InRelease
Hit:2 http://deb.debian.org/debian-security bullseye-security InRelease
Hit:3 http://deb.debian.org/debian bullseye-updates InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
Listing... Done
wine-binfmt/stable 5.0.3-3 all
wine64-preloader/stable 5.0.3-3 amd64
wine64-tools/stable 5.0.3-3 amd64
wine64/stable 5.0.3-3 amd64
wine/stable 5.0.3-3 all

We can see that apt only shows us wine64-* packages, as well as the wine wrapper package, which depends on either wine64 or wine32, as we can see on the output of next command:

# apt info wine
Package: wine
Version: 5.0.3-3
Built-Using: khronos-api (= 4.6+git20180514-2), unicode-data (= 13.0.0-2)
Priority: optional
Section: otherosfs
Maintainer: Debian Wine Party <debian-wine@lists.debian.org>
Installed-Size: 196 kB
Provides: wine
Depends: wine64 (>= 5.0.3-3) | wine32 (>= 5.0.3-3), wine64 (<< 5.0.3-3.1~) | wine32 (<< 5.0.3-3.1~)
Suggests: q4wine, winbind, winetricks, playonlinux, wine-binfmt, dosbox (>= 0.74-4.2~), exe-thumbnailer | kio-extras
Breaks: wine-stable (<< 3.0.1ubuntu1~)
Replaces: wine-stable (<< 3.0.1ubuntu1~)
Homepage: https://www.winehq.org
Tag: game::TODO, interface::graphical, interface::x11, role::metapackage,
 role::program, scope::application, uitoolkit::TODO, use::TODO,
 use::converting, use::gameplaying, use::simulating, x11::application
Download-Size: 136 kB
APT-Sources: http://deb.debian.org/debian bullseye/main amd64 Packages
Description: Windows API implementation - standard suite

So let's suppose we have an old 32bits Windows binary, that we would like to run on our 64bits Debian. We need to install the wine32 package.

apt and dpkg allow us to install packages for "foreign architectures", which means non-default architectures (i.e Linux 64bits) in our case. So we need to instruct these tools to allow us to install 32bits packages.

Here's how to check what currently foreign architectures are configured:

# dpkg --print-foreign-architectures

An empty output, means that no foreign architectures have been setup.

So let's add the i386 architecture to our system, and check that it has been properly taken into account:

# dpkg --add-architecture i386 && dpkg --print-foreign-architectures
i386

Now let's check, what version of wine we can install:

# apt update && apt list "wine*"
Hit:1 http://deb.debian.org/debian bullseye InRelease
Get:2 http://deb.debian.org/debian-security bullseye-security InRelease [48.4 kB]
Hit:3 http://deb.debian.org/debian bullseye-updates InRelease
Get:4 http://deb.debian.org/debian bullseye/main i386 Packages [8122 kB]
Get:5 http://deb.debian.org/debian-security bullseye-security/main i386 Packages [228 kB]
Get:6 http://deb.debian.org/debian bullseye-updates/main i386 Packages [15.1 kB]
Fetched 8414 kB in 4s (2030 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
Listing... Done
wine-binfmt/stable,stable 5.0.3-3 all
wine32-preloader/stable 5.0.3-3 i386
wine32-tools/stable 5.0.3-3 i386
wine32/stable 5.0.3-3 i386
wine64-preloader/stable 5.0.3-3 amd64
wine64-tools/stable 5.0.3-3 amd64
wine64/stable 5.0.3-3 amd64
wine/stable,stable 5.0.3-3 all

Now we can install wine32 (beware! it will pull a whole lot of dependencies).

# apt install wine32
...

We can now run the 32bits version of wine.

# wine --version
wine-5.0.3 (Debian 5.0.3-3)