For most packages that require a yes/no answer, this works fine for me:
sudo apt-get install -y ....
But if you require a package that makes you accept a license, how do you automatically agree to that?
For example, sun java:
sudo apt-get install -y sun-java6-bin sun-java6-jdk sun-java6-jre sun-java6-plugin
This requires me to select OK, and then yes.
There are some ways to do this:
Pre-answer with
debconf
by executing the following command before installing:Use
expect
:For any package, you can use
if in case you have multiple steps like