Scenario: There are a large number of repositories and 3rd party programs which I install whenever I freshly install Linux on my machine, and the process (including config) often takes half a day. I install these programs using the Advanced Package Tool
, and I'm trying to automate this process.
Problem: APT will usually prompt the user to input the keypress 'Y', to confirm an installation, and I am wondering how I would use a Bash script to automate this keypress so that the script can proceed with installation without any human interaction.
Example of keypress:
0 to upgrade, 2 to newly install, 0 to remove and 8 not to upgrade. Need to get 202 kB of archives. After this operation, 736 kB of additional disk space will be used. Do you want to continue? [Y/n] y
Specifications: I have considered condensing all the apt-get
installations into a single apt-get
system call (which is possible), however I want the program to record the success of each installation by monitoring return codes.
I should specify; the keypress will occur during the execution of the system call for: apt-get install **application**
, and I am unsure whether another scripting language such as Ruby
or Python
might not be better suited to this task.
Thanks in advance.