pbuilder and SUN Java

less than 1 minute read

pbuilder with default settings will fail to build a package depending on sun-java5 or sun-java6 because the license needs to be accepted first.

Now some time ago I saw a patch for pbuilder itself to fix this, but for the time beeing I used to set DEBIAN_FRONTEND to readline in my pbuilderrc. But today Michael Koch came up with much better suggestions: Preset the debconf value in the CHROOT and save it.

It’s pretty easy:

$ sudo pbuilder login --save-after-login
[..]
# echo "sun-java5-jdk shared/accepted-sun-dlj-v1-1 boolean true" | debconf-set-selections
# echo "sun-java6-jdk shared/accepted-sun-dlj-v1-1 boolean true" | debconf-set-selections
# exit

and voila, problem solved. Thanks to Michael for the tip.

Update

Manual Prinz suggested a slightly different way which realizes the same debconf setting, but with hooks.