I need apt-get to automatically accept the licence agreement for Sun Java 6, which will be part of a script that generates amazon ec2 images. The rest of the script is all set, and this is the only thing that I need. Any help is appreciated
I need apt-get to automatically accept the licence agreement for Sun Java 6, which will be part of a script that generates amazon ec2 images. The rest of the script is all set, and this is the only thing that I need. Any help is appreciated
sudo apt-get -y install sun-java6-bin
Creativity is allowing yourself to make mistakes; art is knowing which ones to keep.
that's what i though at first too, but -y is only for apt-get itself, for instance overwriting config files. I tried it, and it doesn't touch the EULA. thanks for the reply.
When you install the EULA should come up. Scroll through it, hit the tab key, hit enter.
There are two mistakes one can make along the road to truth...not going all the way, and not starting.
--Prince Gautama Siddharta
#ubuntuforums web interface
is there some way that i could input the "tab" and "enter" keys in the bash script??? I need the eula to be accepted automatically with no user input.
I was certain another java install script posted on this forum used a similar function with --yes
Might have better luck doing a search here, I cant seem to find the exact one.
Creativity is allowing yourself to make mistakes; art is knowing which ones to keep.
For scripting bash you might look into expect or something similar. http://www.kdab.net/~dfaure/scripts.html
The sun-java6-* packages look for the presence of a file to indicate that the license has been accepted. If you pre-create that file your install will probably succeed.
Or, you might consider the openjdk-6 packages. On the server side they are _highly_ compatible with the sun-java6 packages.
Regards,
-james.
thank you for the replies. As of yet, i still haven't found a solution, but please keep posting as I feel that there are many who will find this useful.
DEBIAN_FRONTEND=noninteractive apt-get install -y java5-sun-jre || :
debconf 'echo SET shared/accepted-sun-dlj-v1-1 true; echo $(read) >&2'
apt-get install -y java5-sun-jre
I so much hate dpkg for botching up this license stuff and taking 40 minutes of my life now...
You can echo a tab in bash shells using:
Code:echo $'\t' \n = newline \r = return \t = tab \v = vertical tab \b = backspace \a = "alert" (beep or flash) -or- ASCII octal equivalent of 0xx \0xx
Disclaimer: Aint nuthin right in my left brain and nuthin left in the right
Bookmarks