0

Whenever you're installing a package, it usually prompts for y/n confirmation, is there a way to automate this?

3 Answers 3

4

You might try

yes | install-package.sh 
Sign up to request clarification or add additional context in comments.

4 Comments

awesome! thanks, I didn't think of this. But I have one slight issue. What if I'm trying to install several packages? sudo apt-get install xxx yyy zzz. Do I have to pipe 3 yes to it? Is there a better way to do this?
@izomorphius I was wondering if there was a better way to do this other than having 3 pipes
@Shelby.S: Try it yourself. One pipe is enough.
@choroba ,Shelby that is exactly what I meant
1

on debian based distros you can run:

apt-get -y install <package_to_install> 

to further automate it (in case of installing packages that asks some questions - for example mysql-server asks for db root password) run:

DEBIAN_FRONTEND=noninteractive apt-get -y install <package_to_install> 

Comments

0

Try the -f switch. It probably depends on which package manager you have, so you should check the man-page for your package manager to confirm.

1 Comment

indeed, apt-get has -f switch but it's man page considers it dangerous so I would stick with -y

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.