π ~1 min read
Table of contents
Symptom & Impact
CPU remains elevated for long periods during unattended package maintenance windows.
Environment & Reproduction
Usually observed on small VM instances or hosts with large pending package backlogs.
top -b -n1 | head -n 20
ps -eo pid,cmd,%cpu --sort=-%cpu | head
systemctl status unattended-upgrades --no-pager
Root Cause Analysis
Large dpkg trigger chains and package unpacking saturate CPU and I/O unexpectedly.
Quick Triage
Confirm whether workload is legitimate package maintenance or a stuck loop.
journalctl -u unattended-upgrades -n 120 --no-pager
sudo tail -n 120 /var/log/unattended-upgrades/unattended-upgrades.log
sudo dpkg --audit
Step-by-Step Diagnosis
Inspect package transaction progress and lock ownership in real time.
sudo lsof /var/lib/dpkg/lock-frontend
sudo apt-config dump | grep -i unattended
ps -fp $(pgrep -d, -f unattended-upgrade)

Solution – Primary Fix
Finish pending package operations, then tune upgrade window and reboot policy.
Still having issues? Our Managed IT Services team can diagnose and resolve this for you. Get in touch for a free consultation.
sudo dpkg --configure -a
sudo apt -f install -y
sudo unattended-upgrade --dry-run --debug
sudo systemctl restart unattended-upgrades

Solution – Alternative Approaches
Move heavy upgrades to maintenance windows and disable auto-reboot where required.
sudoedit /etc/apt/apt.conf.d/50unattended-upgrades
sudoedit /etc/apt/apt.conf.d/20auto-upgrades
Verification & Acceptance Criteria
Accepted when CPU usage normalizes and upgrades complete within planned time.
systemctl status unattended-upgrades --no-pager
ps -eo cmd,%cpu --sort=-%cpu | head
apt-cache policy
Rollback Plan
Revert unattended-upgrades configuration to known baseline if tuning causes missed patches.
sudo cp -a /etc/apt/apt.conf.d/50unattended-upgrades.bak /etc/apt/apt.conf.d/50unattended-upgrades
sudo systemctl restart unattended-upgrades
Prevention & Hardening
Keep patch cadence regular to avoid oversized maintenance bursts.
sudo apt update && sudo apt upgrade -y
sudo unattended-upgrade --dry-run
Related Errors & Cross-Refs
Related patterns include apt lock contention, dpkg trigger loops, and long-running postinst scripts.
Related tutorial: View the step-by-step tutorial for Ubuntu 26.04 LTS.
View all Ubuntu 26.04 LTS tutorials on the Tutorials Hub β
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
unattended-upgrades package docs and Ubuntu patch management best practices.
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.