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?
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:
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.
#!/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"
Switching front end only suppresses the question - it still needs to be told. This blog post covers it nicely.
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".