Installing sun-java{5,6} in a pbuilder environment

Asked by Philipp Hagemeister

How do I install sun-java-5-jdk or the -6- equivalent in a pbuilder environment?
Trying to do so fails because of the license of the mentioned packages:

Unpacking sun-java6-jdk (from .../sun-java6-jdk_6-00-2ubuntu2_i386.deb) ...

sun-dlj-v1-1 license could not be presented
try 'dpkg-reconfigure debconf' to select a frontend other than noninteractive

dpkg: error processing /var/cache/apt/archives/sun-java6-jdk_6-00-2ubuntu2_i386.deb (--unpack):
 subprocess pre-installation script returned error exit status 2

Is there any way to tell pbuilder to accept all licenses? dpkg-reconfigure debconf does not seem to have any effect in a pbuilder environment.

Thank you for answering!

Question information

English Edit question
Ubuntu Edit question
No assignee Edit question
Solved by:
Kjell Braden
Last query:
Last reply:
Revision history for this message
Best Kjell Braden (afflux) said :

Find the line in your /etc/pbuilderrc saying

export DEBIAN_FRONTEND="noninteractive"

and change it (with sudo permissions, of course) to

export DEBIAN_FRONTEND="readline"

Save and close the file, build your package and change that line back.

Revision history for this message
Philipp Hagemeister (phihag) said :

Thank you and sorry for the dumb question - I did read the manpage, but not the config files although they are documented there.

Revision history for this message
Maarten Bezemer (veger) said :

I Found this question while searching for a nice solution. I thought to update the question as accepting these licenses on beforehand works nice for me.
This answer is based on:

Add a hook script to /var/cache/pbuilder/hooks/ with a name like D50-add-licenses containing the licenses you want to accept. In this case the script would contain:

#! /bin/sh
debconf-set-selections <<EOF
sun-java5-jdk shared/accepted-sun-dlj-v1-1 boolean true
sun-java6-jdk shared/accepted-sun-dlj-v1-1 boolean true

Note: do not forget to make it executable in order to let pbuilder activate it