Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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

or

$ 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

 
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.