Enable Automatic Updates in Ubuntu Linux

By | 2013/04/20

With Ubuntu or Debian Linux it is possible to enable automatic updates. Here’s how it works!

1. First, install the package unattended-upgrades

$ sudo apt-get install unattended-upgrades

2. Next, edit /etc/apt/apt.conf.d/50unattended-upgrades

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

Uncomment the lines as follows below. The mail setting can be to an email address or local account to notify you if there were any problems. This example is for 10.04 lucid:

// Automatically upgrade packages from these (origin, archive) pairs
Unattended-Upgrade::Allowed-Origins {
        "Ubuntu lucid-security";
        "Ubuntu lucid-updates";

Unattended-Upgrade::Mail "root";

Unattended-Upgrade::Remove-Unused-Dependencies "true";

3. Next, edit the following file and use the values as below.

$ sudo nano /etc/apt/apt.conf.d/10periodic

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "1";
APT::Periodic::Unattended-Upgrade "1";