Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

for ex: if I do like

sudo apt-get upgrade

Then I might get the y/n question before installing an update. What's the parameter to auto accept it.

share|improve this question
    
I don't know it and I would assume it would be -y, but have you tried apt-get -? and see what the program itself says? –  LPChip Apr 16 at 10:43
    
--yes is the way –  caffinatedmonkey Apr 16 at 14:36

1 Answer 1

up vote 8 down vote accepted

There are two ways to do this:

Apt-get specific:

$man apt-get
[...]
-y, --yes, --assume-yes
       Automatic yes to prompts; assume "yes" as answer to all prompts
       and run non-interactively. If an undesirable situation,
       such as changing a held package, trying to install a unauthenticated
       package or removing an essential package occurs then apt-get will abort. 
[...]
--force-yes
       Force yes; this is a dangerous option that will cause apt to continue
       without prompting if it is doing something potentially harmful.
       It should not be used except in very special situations.
       Using force-yes can potentially destroy your system!

General: the yes command:

$man yes
yes - output a string repeatedly until killed [...]
DESCRIPTION
   Repeatedly output a line with all specified STRING(s), or 'y'.

Since yes can't know anything about apt-get internals, it is probably equivalent to --force-yes and thus dangerous. If you still want to do it, you pipe the output of yes into apt-get:

yes | apt-get update
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.