PbuilderHowto

Differences between revisions 1 and 7 (spanning 6 versions)
Revision 1 as of 2005-05-28 20:48:17
Size: 3406
Editor: adsl-213-190-44-43
Comment: imported from the old wiki
Revision 7 as of 2005-10-07 12:59:55
Size: 3534
Editor: pchb1f
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= PbuilderHowto =
Line 5: Line 3:
This document describes the steps to setup a chroot for build Ubuntu packages using pbuilder. It's 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 HoaryHedgehog.
Line 7: Line 5:
You can build packages without pbuilder but you will need all the build dependencies of the package that you need to build installed in your running system. You can build packages without pbuilder but you will need all the build dependencies of the package that you need to build installed on your running system.
Line 36: Line 34:
! APT::Get::AllowUnauthenticated 1;     APT::Get::AllowUnauthenticated 1;
Line 49: Line 47:
If you reach this point you're now with a Hoary chroot ready to build a package. We will
get a Debian source package from Ubuntu repository
to test it.
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.
Line 53: Line 49:
Check if you can download source packages, you will need a uncommented deb-src line at To check if you can download source packages, you will need an uncommented deb-src line in
Line 57: Line 53:
deb-src http://archive.ubuntu.com/ubuntu hoary main restricted     deb-src http://archive.ubuntu.com/ubuntu hoary main restricted
Line 89: Line 85:
OTHERMIRROR="deb http://archive.ubuntu.com/ubuntu hoary universe"     OTHERMIRROR="deb http://archive.ubuntu.com/ubuntu hoary universe"
Line 102: Line 98:
 * change all occurences of {{{hoary}}} in /etc/pbuilderrc and /etc/pbuilderrc/apt.config/ to {{{breezy}}}
 * {{{
sudo pbuilder update --override-config
}}}
 * change all occurences of {{{hoary}}} in /etc/pbuilderrc and /etc/pbuilder/apt.config/ to {{{breezy}}}
 * {{{ sudo pbuilder update --override-config }}}
 * use the --override-config option every time you run the update
Line 110: Line 105:

CategoryDocumentation ["CategoryMOTU"]

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 HoaryHedgehog.

You can build packages without pbuilder but you will need all the build dependencies of the package that you need to build installed on your running system.

Hoary chroot

Install pbuilder package.

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

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

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 wont normally be installed.

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

    sudo pbuilder create --distribution hoary

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 hoary main restricted

If the line above is there but not uncommented, uncomment it and run '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 Hoary 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"

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

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

Upgrading to Breezy

If you want to participate in the current release cycle, you will want to have a BreezyBadger chroot.

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

  •  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)