2

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?

jjmontes
  • 3,387
  • 2
  • 19
  • 27

1 Answers1

5

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.

jjmontes
  • 3,387
  • 2
  • 19
  • 27
  • 4
    Which doesn't mean you should update/upgrade on a live production system without testing the required functionality first. – Deer Hunter 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? – ThemesCreator Oct 23 '14 at 07: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 07:59