Error Codes Wiki

Linux Package Dependency Hell — Broken Packages, Conflicts & Held Back

Errorpackage manager

Overview

Fix Linux package dependency issues including broken packages, unmet dependencies, held-back upgrades, and dpkg/rpm database corruption.

Key Details

  • Dependency hell occurs when packages require conflicting versions of shared libraries
  • apt: 'Unmet dependencies', 'Broken packages', 'The following packages have been kept back'
  • dpkg: 'dpkg was interrupted, you must manually run dpkg --configure -a'
  • Mixing packages from different repositories or releases commonly causes conflicts
  • PPA (Personal Package Archives) are a frequent source of dependency problems

Common Causes

  • Interrupted apt/dpkg operation leaving packages in half-configured state
  • Third-party PPA packages conflicting with official repository versions
  • Mixing packages from different distribution releases (e.g., stable + testing)
  • Manually installing .deb files that depend on unavailable packages
  • Corrupted dpkg/rpm database from disk errors or interrupted operations

Steps

  1. 1Fix interrupted dpkg: sudo dpkg --configure -a
  2. 2Fix broken packages: sudo apt install -f (attempts to resolve dependencies)
  3. 3For held-back packages: sudo apt full-upgrade (allows package removals to resolve conflicts)
  4. 4Remove problematic PPA: sudo add-apt-repository --remove ppa:name/ppa && sudo apt update
  5. 5Nuclear option: sudo apt install -o Dpkg::Options::='--force-overwrite' -f

Tags

linuxaptdpkgdependenciespackage-manager

More in Package Manager

Frequently Asked Questions

A package cannot be upgraded without installing new packages or removing existing ones. Use apt full-upgrade to allow these changes.