Affected versions: Ubuntu 24.04 LTS

πŸ“– ~1 min read

Table of contents
  1. Symptom & Impact
  2. Environment & Reproduction
  3. Root Cause Analysis
  4. Quick Triage
  5. Step-by-Step Diagnosis
  6. Solution – Primary Fix
  7. Solution – Alternative Approaches
  8. Verification & Acceptance Criteria
  9. Rollback Plan
  10. Prevention & Hardening
  11. Related Errors & Cross-Refs
  12. References & Further Reading

Symptom & Impact

System latency spikes when apt-daily and unattended-upgrades run at peak load.

Environment & Reproduction

Observed on small instances with busy application workloads.

top -b -n1 | head -n 20
systemctl list-timers | grep apt
ps -ef | grep unattended-upgrades | grep -v grep

Root Cause Analysis

Default timer windows overlap production traffic and contend for CPU and disk.

Quick Triage

Measure timer schedule and process resource consumption.

systemctl status apt-daily.timer apt-daily-upgrade.timer
sudo journalctl -u unattended-upgrades -n 80 --no-pager
iostat -xz 1 3 2>/dev/null || true

Step-by-Step Diagnosis

Inspect apt periodic settings and current run frequency.

apt-config dump | grep -i periodic
systemctl cat apt-daily.timer
systemctl cat apt-daily-upgrade.timer
Illustrative mockup for ubuntu-24-04-lts β€” terminal_or_shell
Identifying apt-daily timer activity β€” Illustrative mockup β€” Progressive Robot

Solution – Primary Fix

Override timers to run in off-hours with randomized delay.

Still having issues? Our Managed IT Services team can diagnose and resolve this for you. Get in touch for a free consultation.

sudo systemctl edit apt-daily.timer
sudo systemctl edit apt-daily-upgrade.timer
sudo systemctl daemon-reload
sudo systemctl restart apt-daily.timer apt-daily-upgrade.timer
Illustrative mockup for ubuntu-24-04-lts β€” log_or_config
Rescheduling unattended updates safely β€” Illustrative mockup β€” Progressive Robot

Solution – Alternative Approaches

Disable automatic runs and use a controlled maintenance script.

sudo systemctl disable --now apt-daily.timer apt-daily-upgrade.timer
sudo unattended-upgrade -d

Verification & Acceptance Criteria

No daytime spikes from unattended package tasks.

systemctl list-timers | grep apt
sudo journalctl -u unattended-upgrades --since -24h --no-pager

Rollback Plan

Remove timer overrides and re-enable defaults.

sudo rm -rf /etc/systemd/system/apt-daily.timer.d /etc/systemd/system/apt-daily-upgrade.timer.d
sudo systemctl daemon-reload
sudo systemctl enable --now apt-daily.timer apt-daily-upgrade.timer

Prevention & Hardening

Align update windows with change-management schedules.

Can coincide with dpkg lock contention for manual apt jobs.

Related tutorial: View the step-by-step tutorial for Ubuntu 24.04 LTS.

View all Ubuntu 24.04 LTS tutorials on the Tutorials Hub β†’

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

Ubuntu unattended-upgrades and systemd timer override docs.

Need Expert Help?

If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today β€” we respond within one business day.