# Unattended Upgrades

This configuration will enable your entire system to upgrade itself to always keep it up to date and perform automatic reboots if required.

1. `sudo apt-get install unattended-upgrades`
2. Add below to `/etc/apt/apt.conf.d/50unattended-upgrades`:

```bash
Unattended-Upgrade::Origins-Pattern {
    "origin=Debian,archive={{ ansible_distribution_release }}";
    "origin=Debian,archive={{ ansible_distribution_release }}-security";
    "origin=Debian,archive={{ ansible_distribution_release }}-updates";
    "origin=Debian,archive=stable-backports";
    "origin=Anon";
};
Unattended-Upgrade::Remove-Unused-Dependencies "true";
Unattended-Upgrade::Automatic-Reboot "true";
Unattended-Upgrade::Automatic-Reboot-Time "03:00";
```

3. Add below to `/etc/apt/apt.conf.d/20auto-upgrades`:

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

4. `sudo systemctl restart unattended-upgrades`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.anyone.io/relay/maintenance/unattended-upgrades.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
