Affected versions: Debian 9

📖 ~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

`apt full-upgrade` fails with unmet dependencies and blocked package transitions.

Environment & Reproduction

Common after manual pinning or partial upgrades.

cat /etc/debian_version
sudo apt-mark showhold
sudo apt update
sudo apt full-upgrade

Root Cause Analysis

Held packages and pin priorities prevent resolver from completing required upgrades.

Quick Triage

Enumerate holds, pins, and broken package state.

sudo apt-mark showhold
grep -RIn 'Pin:' /etc/apt/preferences /etc/apt/preferences.d 2>/dev/null
sudo apt -f install -y

Step-by-Step Diagnosis

Use resolver debug output to identify blockers.

sudo apt-get -o Debug::pkgProblemResolver=yes dist-upgrade -s
sudo dpkg --audit
sudo tail -n 120 /var/log/apt/term.log
Illustrative mockup for debian-9 — terminal_or_shell
Listing held packages before upgrade — Illustrative mockup — Progressive Robot

Solution – Primary Fix

Remove unnecessary holds and normalize package state.

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

for p in $(apt-mark showhold); do sudo apt-mark unhold $p; done
sudo dpkg --configure -a
sudo apt -f install -y
sudo apt full-upgrade -y
Illustrative mockup for debian-9 — log_or_config
Clearing holds and resolving dependencies — Illustrative mockup — Progressive Robot

Solution – Alternative Approaches

Disable third-party repositories temporarily to isolate conflicts.

sudo mkdir -p /var/tmp/apt-sources-backup
sudo cp -a /etc/apt/sources.list.d /var/tmp/apt-sources-backup/
sudo sed -i 's/^deb/#deb/g' /etc/apt/sources.list.d/*.list
sudo apt update

Verification & Acceptance Criteria

No holds remain and full-upgrade simulation succeeds.

sudo apt-mark showhold
sudo apt-get check
sudo apt full-upgrade -s

Rollback Plan

Reapply required holds after compatibility validation.

sudo apt-mark hold 
sudo cp -a /var/tmp/apt-sources-backup/sources.list.d/* /etc/apt/sources.list.d/
sudo apt update

Prevention & Hardening

Track holds centrally and review before maintenance windows.

apt-mark showhold > /var/tmp/held-packages.txt
apt-cache policy | head -n 120

Related to obsolete repositories, stale pin files, and partial upgrades.

Related tutorial: View the step-by-step tutorial for Debian 9.

View all Debian 9 tutorials on the Tutorials Hub →

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

Debian apt policy and pinning 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.