π ~1 min read
Table of contents
Symptom & Impact
apt exits with unmet dependency errors and package installs fail.
Environment & Reproduction
Common after sudden reboot or network failure during upgrade.
sudo apt upgrade -y
sudo apt install -y nginx
sudo dpkg --audit
Root Cause Analysis
Partially configured packages leave dependency chains unresolved.
Quick Triage
Audit package status and attempt safe dependency repair.
sudo dpkg --audit
sudo apt -f install
sudo apt-cache policy
Step-by-Step Diagnosis
Inspect apt logs and identify first failing package.
grep -iE 'error|broken|unmet' /var/log/apt/term.log | tail -n 50
sudo apt-mark showhold
sudo dpkg -l | awk '$1 ~ /..r|..U|..F/'

Solution – Primary Fix
Complete pending configurations and run full dependency repair.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.
sudo dpkg --configure -a
sudo apt --fix-broken install -y
sudo apt update
sudo apt full-upgrade -y

Solution – Alternative Approaches
Remove conflicting package versions and reinstall required dependencies.
sudo apt remove -y
sudo apt install -y
Verification & Acceptance Criteria
No broken packages remain and upgrades complete cleanly.
sudo dpkg --audit
sudo apt check
sudo apt upgrade -y
Rollback Plan
Pin known-good package versions if regression appears.
sudo apt-cache policy
sudo apt install -y =
Prevention & Hardening
Use reliable mirrors and avoid interrupting apt transactions.
grep -v '^#' /etc/apt/sources.list
sudo systemctl status apt-daily.timer
Related Errors & Cross-Refs
Related to held packages and third-party repository conflicts.
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 package management troubleshooting 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.