π ~1 min read
Table of contents
Symptom & Impact
apt upgrade reports unmet dependencies and leaves the system partially updated.
Environment & Reproduction
Seen after mixed repositories, partial upgrades, or pinned package versions.
cat /etc/os-release
apt-mark showhold
sudo apt update
Root Cause Analysis
The package solver cannot build a consistent set due to holds, pinning, or repo skew.
Quick Triage
Collect held packages and detect broken states first.
apt-mark showhold
sudo apt --fix-broken install -y
sudo dpkg --audit
Step-by-Step Diagnosis
Run dry-runs and inspect apt preferences for conflicting constraints.
sudo apt upgrade --dry-run
sudo apt full-upgrade --dry-run
grep -R 'Pin:' /etc/apt/preferences*

Solution – Primary Fix
Repair dpkg state, clear holds when appropriate, then complete full-upgrade.
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-mark unhold $(apt-mark showhold)
sudo apt update
sudo apt full-upgrade -y

Solution – Alternative Approaches
Temporarily disable third-party sources and retry dependency resolution.
sudo sed -i 's/^deb/# deb/g' /etc/apt/sources.list.d/*.list
sudo apt update
sudo apt install PACKAGE -y
Verification & Acceptance Criteria
Accept when no held or broken packages remain.
sudo apt full-upgrade -y
apt-mark showhold
sudo dpkg --audit
Rollback Plan
Reinstall known-good package versions and hold critical packages if needed.
apt-cache madison PACKAGE
sudo apt install PACKAGE=VERSION -y
sudo apt-mark hold PACKAGE
Prevention & Hardening
Keep sources minimal and avoid mixing unsupported repositories.
sudo pro status
sudo apt update && sudo apt upgrade -y
Related Errors & Cross-Refs
Related errors include held broken packages and requested an impossible situation.
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 packaging documentation and apt preferences guidance.
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.