I have written a bash script which installs a number of packages, however for each consecutive package installation i am promoted with the following message:
After this operation, 1,006 kB of additional disk space will be used.
Do you want to continue [Y/n]?
Is there a way of setting the default to Y so no user input is required? My script is expected to run at night without any intervention
thanks in advance
Two methods come to mind. The first (and better option) is to use the options in your package manager. For example:
if you use
apt(typeapt-get install --helpfor more help there).The second is more of a quick-‘n-dirty one…use a pipe after
yes:which always brings a smile to my face :p
The latter option also answers yes to ALL other questions, which can be handy (errors etc.) but can be risky (which is the reason those questions are there in the first place!)