I have just started learning web server administration. I have noticed that I get this update message very often on Ubuntu:

xx packages can be updated
xx updates are security update

When I see it I do:

sudo apt-get update
sudo apt-get upgrade

If this correct? Is there a way make this task automatically, maybe all days at the same hours or when x updates are available?


Yes it is correct. Ubuntu repositories receive upgrades quite often, so you are likely to see pending security upgrades around once a week or more, depending on the packages you've installed. You are doing the right thing, but as you have guessed you can automate this.

You are looking for "unattended upgrades" (https://help.ubuntu.com/community/AutomaticSecurityUpdates).

Unattended upgrades is an APT feature and allows you to upgrade packages (you can choose if you wish only security upgrades or all, etc).

When you use unattended upgrades for security issues, you will receive mails telling you whether you need to reboot any host as a result of the upgrades.

  • 4
    Which doesn't mean you should update/upgrade on a live production system without testing the required functionality first. Oct 22 '14 at 18:28
  • And what does this mean? I should have other server exactly with the same configuration to test the updates? this should be an online server or local? Oct 23 '14 at 7:50
  • To me, it means that when you have testing environments, you shall apply upgrades only to testing/preproduction environments first, and then roll out to production. In practice, Ubuntu security updates are very stable, and it's very unlikely that they break anything, especially if you use a common stack of software (ie. LAMP).
    – jjmontes
    Oct 23 '14 at 7:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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