Tuesday, April 30, 2024
 Popular · Latest · Hot · Upcoming
133
rated 0 times [  133] [ 0]  / answers: 1 / hits: 178398  / 2 Years ago, fri, april 1, 2022, 5:46:44

I am trying to write a bash script to install a list of software. I am using --assume-yes to get past the prompts.



This following line somehow doesn't work:



sudo apt-get install python-software-properties --assume-yes


If I try to apt-get without --assume-yes it works but the prompt asks me to:



please [Enter] to continue or ctrl+c to cancel adding it


How do I add Enter as a command when running apt-get install instead of using --assume-yes?


More From » apt

 Answers
4

Your problem is that the option should be before the packages, not after, this is the correct syntax:



apt-get <options> command package=version/release


So, for it to work it should be:



sudo apt-get --assume-yes install python-software-properties


apt-get is forgiving when mixing up command and options, but to err on the safe side, you should always use the options before the command and never put options or commands after the name of the package.


[#26004] Friday, April 1, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
avilyexplor

Total Points: 20
Total Questions: 102
Total Answers: 120

Location: Maldives
Member since Mon, Jun 21, 2021
3 Years ago
;