How to cross-compile an existing deb package from 64bit to 32bit architecture

I have rebuilt a deb package with a custom patch for my computer which is a 64bit machine. I did it using:

sudo apt-get -b source [package name]

Now my question is, how to do that in a similar manner to cross-compile the same package for 32bit machines?

Thanks, Nicolay


It is mostly not possible to cross-compile a 32bit package from a 64bit deb package if the package contains any source files or libraries.

You'll need to repackage using the 32bit libraries and recompile the source code.

My suggestion would be to split your compile and packaging - do your 32bit work in a separate 32bit Virtual Machine.

Perhaps better, would be to set up a LaunchPad PPA and let Launchpad do the compiling for both 64bit and 32bit architectures automatically.


You can use a cross-compile environment and/or some helper tools.

Personally I favour xdeb it have never failed me!

This guide: Using Xdeb will help you setup the Xdeb environment and how to use the tools.