pbuilder: Building i386 packages on x64 hosts


A wonderful thing when creating packages with pbuilder would be to have the freedom to build packages for i386 archs on x64 hosts. Well, thats easy using recent versions of pbuilder (I don’t know since when this is possible). The first step is to have those architectures created with pbuilder previously. let’s do it:

pbuilder-dist precise i386 create

When it’s done, create the x64 sistem base (since I’ve a x64 machine, isn’t necessary to specify the architecture to pbuilder, ’cause this creates a system base according to the host arch):

pbuilder-dist precise create

So, when we want to build a package for i386, just do:

pbuilder-dist precise i386 *.dsc

For x64 packages we do it as for any package:

pbuilder-dist precise *.dsc

This is because we have a x64 host, and pbuilder with no arch specified, will build packages for the host’s arch. A really nice tip.


One response »

  1. hell yeah, what a marvelous peace of software pbuilder is!, if you don’t have pbuilder-dist you can do it raw this way:

    $ sudo DIST=precise ARCH=i386 pbuilder

    I’ve created some aliases:

    alias pbuilder.precise.i386=’sudo DIST=precise ARCH=i386 pbuilder’
    alias pbuilder.precise.amd64=’sudo DIST=precise ARCH=amd64 pbuilder’

    Useful when you host 1 .bashrc file among several different laptops (amd64|x86), you don’t have a ‘default’ architecture

    Also if you use pbuilder-dist or a custom alias, it’s useful to update /etc/bash_completion.d/pbuilder to enable autocompletion ;), mine looks like this: https://gist.github.com/2015071

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s