# Configure Automatic Updates

### Setting up automatic updates

#### Installing <span class="app application">unattended-upgrades</span> package

1. Install unattended-upgrades package  
      
    `apt-get install unattended-upgrades`

#### Configuring unattended-upgrades

1. Edit <span class="file filename">/etc/apt/apt.conf.d/50unattended-upgrades</span> and adjust the following

```
Unattended-Upgrade::Allowed-Origins {
        "${distro_id}:${distro_codename}";
        "${distro_id}:${distro_codename}-security";
//      "${distro_id}:${distro_codename}-updates";
//      "${distro_id}:${distro_codename}-proposed";
//      "${distro_id}:${distro_codename}-backports";
};
```

#### Enable automatic updates

1. Edit <span class="file filename">/etc/apt/apt.conf.d/20auto-upgrades</span> and set the appropriate <span class="app application">apt</span> configuration options

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