i am creating a slient setup script on an ubuntu machine that also installs additional packages. one problem i am having is that the sun java package needs a manual confirmation of the license agreement. is there a chance that i can automate the installation so, that the process does not wait until i manually confirm the dialog?

link|improve this question
feedback

4 Answers

I believe the package asks about the license using Debconf. You can change what frontend debconf uses to ask you questions, or even set it to have no frontend, for unattended installs. Here's a quick article about it:

http://www.debianadmin.com/debconf-debian-configuration-management-system.html

link|improve this answer
feedback

I automate most program installations on Unix and Unix-like systems using Expect scripts. Expect is targeted at interacting with other programs via scripts and these are very easy to write.

example:

#!/usr/bin/expect -f
sudo apt-get install sun-java6-jre
expect "Password:"
sleep 1
send -- "mypassword\r"
expect "[y/n]"
sleep 1
send -- "yes\r"
link|improve this answer
Improvement edit war! haha! Beat you to it by 2 mins though =D – BloodPhilia Jun 28 '10 at 18:19
feedback

Switching front end only suppresses the question - it still needs to be told. This blog post covers it nicely.

link|improve this answer
feedback

When using a shell script, try using send and expect. Make sure you have them installed. Also check out http://www.manpagez.com/man/1/expect/.

#! /usr/bin/expect -f

apt-get install sun-java6-jre
expect "[y/n]"
sleep 1
send "y\r"

This script calls the installer and then waits for it to output "[y/n]". When this is outputted, the script continues after 1 sec sleep by sending "y" along with a new line "\r".

link|improve this answer
feedback

Your Answer

 
or
required, but never shown