PbuilderHowto

Differences between revisions 10 and 11
Revision 10 as of 2005-10-07 13:46:01
Size: 3651
Editor: pchb1f
Comment:
Revision 11 as of 2005-10-26 14:51:11
Size: 4007
Editor: p5494FC76
Comment: updated to dapper
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
This document describes the steps to setup a chroot jail for building Ubuntu packages using pbuilder. It is recommended for Ubuntu maintainers or anyone interested in building packages using HoaryHedgehog. This document describes the steps to setup a chroot jail for building Ubuntu packages using pbuilder. It is recommended for Ubuntu maintainers or anyone interested in building packages using Ubuntu
Line 7: Line 7:
The following assume you want to install "breezy". If you need a "hoary" or "dapper" chroot, then exchange "breezy" with the appropriate distribtion.
Line 8: Line 9:
== Hoary chroot == == Installing Pbuilder ==
Line 15: Line 16:
    DISTRIBUTION=hoary     DISTRIBUTION=breezy
Line 17: Line 18:
Line 36: Line 38:
Line 39: Line 42:
Save the file and run the command below to build your hoary chroot: Save the file and run the command below to build your breezy chroot:
Line 42: Line 45:
    sudo pbuilder create --distribution hoary     sudo pbuilder create --distribution breezy
Line 53: Line 56:
    deb-src http://archive.ubuntu.com/ubuntu hoary main restricted     deb-src http://archive.ubuntu.com/ubuntu breezy main restricted 
Line 55: Line 58:
Line 76: Line 80:
== Updating Hoary chroot == == Updating a chroot ==
Line 89: Line 93:
    OTHERMIRROR="deb http://archive.ubuntu.com/ubuntu hoary universe"     OTHERMIRROR="deb http://archive.ubuntu.com/ubuntu hoary universe multiverse"
Line 98: Line 102:
== Upgrading to Breezy == == Upgrading to Latest Development Release ==
Line 100: Line 104:
If you want to participate in the current release cycle, you will want to have a BreezyBadger chroot. If you want to participate in the current release cycle, you will want to have a DapperDrake chroot. Sometimes, the development version may not be installable directly. In this case, you have to install the latest release first, and upgrade then to development release
Line 102: Line 106:
 * change all occurences of {{{hoary}}} in /etc/pbuilderrc and /etc/pbuilder/apt.config/ to {{{breezy}}}  * change all occurences of {{{breezy}}} in /etc/pbuilderrc and /etc/pbuilder/apt.config/ to {{{dapper}}}

Introduction

This document describes the steps to setup a chroot jail for building Ubuntu packages using pbuilder. It is recommended for Ubuntu maintainers or anyone interested in building packages using Ubuntu

You can build packages without pbuilder but you must already have all the build dependencies of the package that you are building installed on your running system.

The following assume you want to install "breezy". If you need a "hoary" or "dapper" chroot, then exchange "breezy" with the appropriate distribtion.

Installing Pbuilder

Install pbuilder package.

Edit /etc/pbuilder/pbuilderrc changing the following directives:

    MIRRORSITE=http://archive.ubuntu.com/ubuntu
    DISTRIBUTION=breezy

Since pbuilder will complain about unauthenticated packages, you have to allow unauthenticated packages. You can make it like so:

Edit your /etc/pbuilder/pbuilderrc:

    APTCONFDIR="/etc/pbuilder/apt.config/"

Now you'll copy needed files of /etc/apt to it and

    sudo mkdir /etc/pbuilder/apt.config/
    sudo cp -ar /etc/apt/* /etc/pbuilder/apt.config/
    sudo touch /etc/pbuilder/apt.config/apt.conf.d/allow-unauthenticated

and add the following line to /etc/pbuilder/apt.config/apt.conf.d/allow-unauthenticated

    APT::Get::AllowUnauthenticated 1;

NOTE: Make sure to remove 99update-notifier from /etc/pbuilder/apt.config/apt.conf.d/ if you have copied it in the last step. It can potentially break future updates to your pbuilder chroot, as update-notifier won't normally be installed.

Save the file and run the command below to build your breezy chroot:

    sudo pbuilder create --distribution breezy

Rebuilding a package

If you reach this point you now have a Hoary chroot located at /var/cache/pbuilder ready to build a package. We will get a Debian source package from Ubuntu repository to test it.

To check if you can download source packages, you will need an uncommented deb-src line in /etc/apt/sources.list, containing:

    deb-src http://archive.ubuntu.com/ubuntu breezy main restricted 

If the line above is there but not uncommented, uncomment it. Make sure your package index files are synchronized so that apt-get knows where to find the sources:

    sudo apt-get update

We will build bc, a simple calculator, from source, let's download the debian source package from ubuntu repository:

    sudo apt-get source bc

You can build the package using your Hoary chroot with the command:

    sudo pbuilder build *.dsc

In the end, the binary and source package will be at /var/cache/pbuilder/result/

Updating a chroot

I recommend you update your chroot before each build, to this task use the comand below:

    sudo pbuilder update

Universe support

If you want to rebuild a package from universe or build a new one that needs a package out of main you will need to edit /etc/pbuilderrc again, changing:

    OTHERMIRROR="deb http://archive.ubuntu.com/ubuntu hoary universe multiverse"

Now you need to update your chroot with the new configuration:

    sudo pbuilder update --distribution hoary --override-config

Upgrading to Latest Development Release

If you want to participate in the current release cycle, you will want to have a DapperDrake chroot. Sometimes, the development version may not be installable directly. In this case, you have to install the latest release first, and upgrade then to development release

  • change all occurences of breezy in /etc/pbuilderrc and /etc/pbuilder/apt.config/ to dapper

  •  sudo pbuilder update --override-config 

  • use the --override-config option every time you run the update

See also

pbuilder User's Manual: http://www.netfort.gr.jp/~dancer/software/pbuilder-doc/pbuilder-doc.html

CategoryDocumentation ["CategoryMOTU"]

PbuilderHowto (last edited 2020-01-28 13:36:36 by paelzer)