Linux Package Dependency Hell — Broken Packages, Conflicts & Held Back
About Linux Package Dependency Hell
Fix Linux package dependency issues including broken packages, unmet dependencies, held-back upgrades, and dpkg/rpm database corruption. This guide covers everything you need to know about this topic, including common causes, step-by-step solutions, and answers to frequently asked questions.
Here are the key things to understand: 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. Understanding these fundamentals will help you diagnose and resolve this issue more effectively.
The most common reasons this occurs include: 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. Identifying the root cause is the first step toward finding the right solution.
To resolve this, follow these recommended steps: Fix interrupted dpkg: sudo dpkg --configure -a. Fix broken packages: sudo apt install -f (attempts to resolve dependencies). For held-back packages: sudo apt full-upgrade (allows package removals to resolve conflicts). Remove problematic PPA: sudo add-apt-repository --remove ppa:name/ppa && sudo apt update. Nuclear option: sudo apt install -o Dpkg::Options::='--force-overwrite' -f. If these steps do not resolve the issue, consider consulting additional resources or a qualified professional.
This article is part of our Linux Error Codes collection on Error Codes Wiki. We provide comprehensive, up-to-date information to help you find solutions quickly.
Quick Answer
What does 'kept back' mean?
A package cannot be upgraded without installing new packages or removing existing ones. Use apt full-upgrade to allow these changes.
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
- 1Fix interrupted dpkg: sudo dpkg --configure -a
- 2Fix broken packages: sudo apt install -f (attempts to resolve dependencies)
- 3For held-back packages: sudo apt full-upgrade (allows package removals to resolve conflicts)
- 4Remove problematic PPA: sudo add-apt-repository --remove ppa:name/ppa && sudo apt update
- 5Nuclear option: sudo apt install -o Dpkg::Options::='--force-overwrite' -f