Score:1

apt install with multiple prompted arguements

pl flag

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.

cocomac avatar
cn flag
`apt-get install openjdk-8-jdk -y` should work fine (although note that it isn't reccomended to use `apt`/`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 answer `105` for? Also, see [this question](https://askubuntu.com/questions/519/how-do-i-write-a-shell-script-to-install-a-list-of-applications)
Jamalan avatar
pl flag
What should I use instead to do installs for a setup.sh type file? And it prompts for region/country/timezone type things where it shows a list and you have to input the number corresponding to the thing.
cocomac avatar
cn flag
Um... it shouldn't ask for those things when you install stuff. Can you see if it still happens in a live CD? Perhaps you didn't configure the region, but assuming a properly configured installation of a supported version of Ubuntu, `apt-get install openjdk-8-jdk -y` should just work. You shouldn't need to give the region.
Jamalan avatar
pl flag
Its running on a cloud vm. Specifically in a cloud hosted jupyter notebook. Not sure how much control I have over it, and if I change it I'd need to change it programmatically and include it in a setup script. Also, can you expand on what I should use instead of apt-get install for a setup script?
user535733 avatar
cn flag
The environment (VM and particularly Jupyter) are important! Those key facts need to be up in the Question, not buried in comments.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.