How can I build a 32bit (i386) .deb on a 64bit box? How can I build a 32bit (i386) .deb on a 64bit box? c c

How can I build a 32bit (i386) .deb on a 64bit box?


The answer depends on the complexity of your build. When the normal 64 bit userland tools suffice for a build, simply specify the architecture via -a

debuild -ai386

However, there are often cases where this doesn't work, and in these cases you'll need pbuilder. pbuilder builds a clean Debian/Ubuntu system in a chroot-ed environment. man pbuilder is a good introduction. To get started, you'll need:

sudo pbuilder --create --architecture i386sudo pbuilder --build mypackage.dsc


It starts with calling debuild with the -ai386 option, which willchange the architecture that the package is built for.

Of course you have to ensure that the package contains the i386 build of the application.


You don't do anything thing different from building a 64bit .deb. Except that you include a 32bit build of your application.

The control file specifies the architecture, so be sure you select the correct one.