I'm trying to create a setup.sh script that includes the following
apt-get install openjdk-8-jdk
However, it prompts a yes/no during install but then also prompts to key in regions/countries/continents which have numeric responses. This will be consistent for my purposes, how can I pass in the prompt responses for this? -y
works when everything is a yes or no question, but what about multiple prompts of mixed types?
I'd like to respond 'y',105,2, etc.
EDIT: This is running in a hosted Jupyter Lab Cloud VM on Gradient by Paperspace. I'm running these commands from the terminal as root on 18.04, I have to install java 8 and some python packages. The VM comes preloaded with python3 but not java 8, and I want to create a setup script that doesn't need interaction from the user.
apt-get install openjdk-8-jdk -y
should work fine (although note that it isn't reccomended to useapt
/apt-get
in scripts). AFAIK,openjdk-*-*
packages shouldn't have any dialogs that you have to choose. What exactly is it prompting you that you need to answer105
for? Also, see this question – cocomac Dec 25 '21 at 02:54apt-get install openjdk-8-jdk -y
should just work. You shouldn't need to give the region. – cocomac Dec 25 '21 at 03:05