# Setting Up Automatic Updates on Debian

Having automatic updates on linux machine can be beneficial to stay up to date with latest patches. At very least security updates should be enabled

##### Set up Automatic Updates

1. Install Unattended Upgrades

```bash
sudo apt install unattended-upgrades apt-listchanges
```

At Very Least Reconfigure Unattended Upgrades for Security Patches

```bash
sudo dpkg-reconfigure --priority=low unattended-upgrades
```

2. Configure **unattended-upgrades** file

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

You can enable security updates and other types of updates by uncommenting the appropriate lines.

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

3. Enable Automatic Updates

```bash
sudo nano /etc/apt/apt.conf.d/20auto-upgrades
```

Add or Modify following lines

```
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
```

This configuration will check for updates daily