TechBuzzPro

Automated Software Updates on a Dedicated Server

· 5 min read · Apps & Browsers

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Setting up automated software updates on a dedicated server means configuring the operating system's package manager to install security patches and bug fixes on a schedule, usually daily, without manual intervention. The shortest working method on Debian or Ubuntu is to install the unattended-upgrades package, enable it, and confirm it is running; on RHEL-based systems you use dnf-automatic. Both approaches can be limited to security updates only, which is the safest default for a production server. Before you start, make sure you have root or sudo access and a recent backup, because updates can occasionally break custom configurations.

What You'll Need

  • Root or sudo access to the server (SSH or console).
  • A recent backup or snapshot of the server, in case an update causes problems.
  • Knowledge of your distribution: Debian/Ubuntu use apt, RHEL/CentOS/AlmaLinux/Rocky use dnf or yum.
  • Access to the server's log files (usually /var/log) to verify updates ran.
  • Optionally, an email relay or monitoring tool if you want alerts about update results.

Step-by-Step

  1. Identify your distribution and package manager. Run cat /etc/os-release to see the OS name and version. This determines which tool you will use. The steps below cover Debian/Ubuntu and RHEL-family systems; menu and command names can differ slightly by version, so check your distribution's documentation if a command is not found.
  2. Update the package list and existing packages first. On Debian/Ubuntu run sudo apt update && sudo apt upgrade. On RHEL-family run sudo dnf update. This ensures the automated tool starts from a clean state and reduces the chance of a large backlog on the first run.
  3. Install the automatic update tool. On Debian/Ubuntu: sudo apt install unattended-upgrades. On RHEL-family: sudo dnf install dnf-automatic. These are the official packages provided by the distribution.
  4. Enable the tool. On Debian/Ubuntu run sudo dpkg-reconfigure --priority=low unattended-upgrades and choose Yes when asked to automatically download and install updates. On RHEL-family run sudo systemctl enable --now dnf-automatic.timer.
  5. Configure which updates are applied. On Debian/Ubuntu edit /etc/apt/apt.conf.d/50unattended-upgrades and ensure the security origins are uncommented; leave other origins commented out if you want security-only updates. On RHEL-family edit /etc/dnf/automatic.conf and set upgrade_type = security and apply_updates = yes.
  6. Set the schedule. On Debian/Ubuntu the tool runs via systemd timers; you can check them with systemctl list-timers apt-daily-upgrade.timer. On RHEL-family the timer runs daily by default; adjust with systemctl edit dnf-automatic.timer if you need a different time.
  7. Test the configuration. On Debian/Ubuntu run sudo unattended-upgrade --dry-run --debug to see what would be installed without making changes. On RHEL-family run sudo dnf-automatic --downloadupdates or check the logs after the first scheduled run.
  8. Check the logs after the first run. On Debian/Ubuntu look at /var/log/unattended-upgrades/unattended-upgrades.log. On RHEL-family use journalctl -u dnf-automatic.service. Confirm that updates were applied and no errors occurred.
  9. Decide whether to allow automatic reboots. Some updates, especially kernel updates, require a reboot. By default most tools do not reboot automatically. If you want reboots, configure them explicitly (for example, set Unattended-Upgrade::Automatic-Reboot "true"; on Debian/Ubuntu) and choose a maintenance window. Otherwise, plan to reboot manually after kernel updates.
  10. Set up notifications (optional but recommended). Configure the tool to email you the results, or use your existing monitoring to watch the log files. This way you learn about failures without logging in every day.

Common Mistakes

  • Enabling all repositories instead of security only. This can pull in major version upgrades that break applications. Start with security updates only.
  • Forgetting to test the configuration. A dry run catches syntax errors and unexpected package selections before they hit production.
  • Ignoring kernel updates that need a reboot. The system keeps running the old kernel until you reboot, so security fixes are not active.
  • Not checking logs. Automated updates can fail silently due to lock files, network issues, or repository errors.
  • Assuming all software is covered. Package managers update software installed from repositories, not apps you compiled from source or installed manually.

Tips

  • Schedule updates during low-traffic hours to minimise disruption.
  • Keep a snapshot or backup before the first automated run so you can roll back if something breaks.
  • Use a staging server to test update policies before applying them to production.
  • Regularly review which packages are being updated; unexpected packages may indicate a configuration error.
  • Combine automated security updates with a manual monthly review for non-security updates.

Troubleshooting

If updates are not running, first check that the service or timer is active: systemctl status unattended-upgrades or systemctl status dnf-automatic.timer. If it is inactive, enable and start it. Next, check the logs for errors such as a held package, a missing repository, or a lock file. A common issue is a package in a "held" state that blocks upgrades; resolve it with apt-mark unhold <package> or the equivalent. If the server has no internet access or a proxy, configure the package manager to use the proxy. If updates install but the system behaves oddly, check whether a reboot is pending and whether custom configuration files were overwritten; restore from backup if needed.

Frequently Asked Questions

Will automatic updates restart my services?

Some services restart automatically when their packages are updated, but many do not. Check your distribution's behaviour and plan manual restarts if uptime is critical.

Can I exclude specific packages from automatic updates?

Yes. On Debian/Ubuntu you can blacklist packages in the unattended-upgrades configuration. On RHEL-family you can use the exclude option in dnf configuration.

Do automatic updates cover third-party software?

Only if that software is installed from a repository configured on the server. Software installed manually or from source is not covered.

Is it safe to enable automatic reboots?

Only if your server can tolerate downtime and you have verified that services start correctly after a reboot. Otherwise, reboot manually during a maintenance window.

How do I know if an update failed?

Check the logs mentioned above. Most tools log errors clearly. Setting up email notifications makes failures visible without logging in.

Can I roll back an automatic update?

Package managers generally do not support automatic rollback. Restore from a backup or snapshot if an update causes problems.