apt Unmet Dependencies — Broken Packages and Dependency Resolution Failures
About apt Unmet Dependencies
Fix apt 'unmet dependencies' and 'broken packages' errors on Debian and Ubuntu when package installations fail due to conflicting or missing dependencies. 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: apt resolves package dependencies automatically but can fail when versions conflict. Broken packages occur when a partially installed package has unsatisfied dependencies. Mixing repositories (Ubuntu main with PPAs, different release versions) is the most common cause. dpkg --configure -a finishes configuring partially installed packages. apt --fix-broken install attempts to resolve broken dependencies automatically. Understanding these fundamentals will help you diagnose and resolve this issue more effectively.
The most common reasons this occurs include: Interrupted installation (power loss, Ctrl+C) leaving packages in a half-installed state. PPA repository providing packages that conflict with official Ubuntu repository versions. Manual dpkg -i of a .deb package without its dependencies being available. Mixing package sources from different Ubuntu releases (e.g., Jammy packages on Focal). Identifying the root cause is the first step toward finding the right solution.
To resolve this, follow these recommended steps: Try automatic fix: 'sudo apt --fix-broken install' to resolve dependency issues. Configure pending packages: 'sudo dpkg --configure -a' to finish interrupted installations. Force fix with specific version: 'sudo apt install package=version' to install a compatible version. Remove the conflicting package: 'sudo apt remove conflicting-package' then retry installation. Last resort: 'sudo apt clean && sudo apt update && sudo apt --fix-broken install'. 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
Is apt --fix-broken install safe?
Generally yes. It attempts to install missing dependencies or remove the broken package. It shows what it plans to do before executing. Review the proposed changes before confirming, especially if it wants to remove packages.
Overview
Fix apt 'unmet dependencies' and 'broken packages' errors on Debian and Ubuntu when package installations fail due to conflicting or missing dependencies.
Key Details
- apt resolves package dependencies automatically but can fail when versions conflict
- Broken packages occur when a partially installed package has unsatisfied dependencies
- Mixing repositories (Ubuntu main with PPAs, different release versions) is the most common cause
- dpkg --configure -a finishes configuring partially installed packages
- apt --fix-broken install attempts to resolve broken dependencies automatically
Common Causes
- Interrupted installation (power loss, Ctrl+C) leaving packages in a half-installed state
- PPA repository providing packages that conflict with official Ubuntu repository versions
- Manual dpkg -i of a .deb package without its dependencies being available
- Mixing package sources from different Ubuntu releases (e.g., Jammy packages on Focal)
Steps
- 1Try automatic fix: 'sudo apt --fix-broken install' to resolve dependency issues
- 2Configure pending packages: 'sudo dpkg --configure -a' to finish interrupted installations
- 3Force fix with specific version: 'sudo apt install package=version' to install a compatible version
- 4Remove the conflicting package: 'sudo apt remove conflicting-package' then retry installation
- 5Last resort: 'sudo apt clean && sudo apt update && sudo apt --fix-broken install'