Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Running apt-get update, there are a few hundred minor patches to apply. APT decides to stop postgres from running, spend 20 minutes applying all the patches, then starts postgres at the end.

If I look through the patch list and spot postgres then I can run "apt-get install postgres" and it's quite happy to upgrade that package on its own, only having enough downtime to upgrade that one package. Then I can upgrade the rest as a second step, and postgres stays up.

Is there any setting I'm missing that would tell apt-get to stop/upgrade/start services individually, rather than in giant groups or me having to break them up by hand?

share|improve this question
up vote 2 down vote accepted

You could do something like this:

$ sudo aptitude -F%p --disable-columns search ~U | xargs -n 1 sudo apt-get install


$ sudo apt-get -s upgrade | awk '/^Inst/ { print $2 }' | xargs -n 1 sudo apt-get install

This will install each available upgrade individually.

Keep in mind that the above command doesn't take into account package dependencies, so you may end up with some steps installing more than one package. I'm not aware of a way to get aptitude or apt-get to output packages in order of their dependence on each other.

share|improve this answer

Your Answer


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.