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

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

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 :
#2

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 :
#3

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: http://lists.debian.org/debian-java/2008/05/msg00024.html

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
EOF

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