Enable Automatic Updates for Ubuntu 12.04 Server

If you would like to enable automatic updates on your Ubuntu 12.04 server, then please follow the steps below:

First install the unattended-upgrades package:

sudo apt-get install unattended-upgrades

When the package has installed, edit the following file.  This will change the freequency for each action (1 = daily, and 7 = weekly):

sudo nano /etc/apt/apt.conf.d/10periodic
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::Unattended-Upgrade "1";

Now edit the following file to enable the type of updates you want, I recommend the following:

sudo nano /etc/apt/apt.conf.d/50unattended-upgrades

// Automatically upgrade packages from these (origin:archive) pairs
Unattended-Upgrade::Allowed-Origins {
//      "${distro_id}:${distro_codename}-proposed";
//      "${distro_id}:${distro_codename}-backports";

Your server should now update automatically.

Reference: http://askubuntu.com/questions/172524/how-can-i-check-if-automatic-updates-are-enabled