How to fix The following packages have unmet dependencies in APT
This error occurs when apt tries to install a package but cannot find compatible versions of its required dependencies. Common causes include incompatible package versions, corrupted package cache, or held packages. Resolving it typically involves updating repositories, fixing broken packages, or removing conflicting packages.
Quick fix
Fixes The following packages have unmet dependencies
sudo apt update- Update your package repositories
- Try apt upgrade and apt fix-broken install
- Use apt dist-upgrade for complex dependency issues
- Check for held packages
sudo apt updateThe following packages have unmet dependencies
What this error means
When apt encounters unmet dependencies, it means the package you are trying to install depends on other packages that either do not exist in your repositories, have incompatible versions, or have broken dependency chains. This can happen when upgrading a system with outdated packages, installing from third-party PPAs with conflicting versions, or when the package cache becomes corrupted. Apt refuses to proceed with the installation to prevent leaving your system in an inconsistent or broken state.
Typical symptoms
- apt install or apt upgrade fails with "The following packages have unmet dependencies" message
- Installation of a specific package is blocked because its dependencies cannot be satisfied
- System upgrade (apt upgrade or apt dist-upgrade) stops and requires manual intervention
- Package manager shows broken packages or uninstallable packages
- Error includes a list of package names with version requirements that cannot be met
- Running apt install on any package fails with similar dependency errors
Common causes
- Package repositories contain incompatible versions of dependencies (especially with PPAs)
- Package cache is corrupted or contains stale metadata (requires apt cache refresh)
- Packages are held back using apt-mark hold, preventing upgrades or removals needed to resolve dependencies
- Third-party repositories provide packages built for different Ubuntu/Debian versions
- System is missing packages from a repository that was removed or disabled
- Installation of newer versions of packages that break compatibility with older installed packages
- Multiple PPAs providing conflicting versions of the same package
How to fix "The following packages have unmet dependencies"
Start by refreshing your package lists to ensure apt has current information about available packages and versions:
sudo apt updateThis fetches the latest package metadata from your configured repositories. After running this, try your installation again, as the issue may have been caused by stale cache.
Upgrade your currently installed packages to their latest compatible versions, then attempt to fix any broken dependencies:
sudo apt upgrade
sudo apt --fix-broken installThe --fix-broken option tells apt to resolve dependency issues by removing conflicting packages if necessary. This often resolves unmet dependencies caused by partial upgrades.
If regular upgrade does not work, use dist-upgrade, which performs a more aggressive upgrade and is better at resolving dependency conflicts:
sudo apt dist-upgradeNote that dist-upgrade may remove packages to resolve conflicts, so review the output carefully before confirming. For production systems, test this on a non-critical environment first.
Held packages prevent apt from modifying them to resolve dependencies. List any held packages:
apt-mark showholdIf you see packages listed, consider unholding them temporarily to allow apt to resolve dependencies:
sudo apt-mark unhold <package-name>After resolving the dependency issue, you can hold the package again if desired.
If the above steps fail, you may need to remove the conflicting package. First, simulate the removal with a dry-run to see what would be removed:
sudo apt remove --dry-run <package-name>If the output looks safe, proceed with the actual removal:
sudo apt remove <package-name>Then try installing the package you originally wanted.
As a nuclear option, clear the apt cache and reinstall the problematic package:
sudo apt clean
sudo apt autoclean
sudo apt install --reinstall <package-name>This removes all cached package files and forces apt to re-download and verify them. Use this only after other solutions have failed, as it forces a fresh installation of the entire package and its dependencies.
If the error persists, check if you have third-party PPAs that provide conflicting packages:
ls /etc/apt/sources.list.d/Disable or remove problematic PPAs by renaming their files or removing them entirely:
sudo mv /etc/apt/sources.list.d/problematic-ppa.list /etc/apt/sources.list.d/problematic-ppa.list.bak
sudo apt updateThen try your installation again. PPAs from different maintainers often have conflicting package versions.
Advanced notes
For systems with multiple PPAs, dependency conflicts are common because different maintainers may build packages for different Ubuntu/Debian versions or have different dependency requirements. Use apt-cache policy <package> to see which version will be installed and from which repository. The package manager aptitude (install with sudo apt install aptitude) offers more advanced dependency resolution than apt-get and can sometimes resolve conflicts that apt cannot. Debug held packages with sudo apt -o Debug::pkgProblemResolver=yes dist-upgrade to see the full decision-making process. In Docker containers, always run apt update before installing packages to prevent stale cache issues. For multi-architecture systems (amd64/i386/arm64), ensure you understand architecture-specific dependencies, as mixing architectures can cause unmet dependency errors.
Frequently asked questions
- What does "The following packages have unmet dependencies" mean?
- When apt encounters unmet dependencies, it means the package you are trying to install depends on other packages that either do not exist in your repositories, have incompatible versions, or have broken dependency chains. This can happen when upgrading a system with outdated packages, installing from third-party PPAs with conflicting versions, or when the package cache becomes corrupted. Apt refuses to proceed with the installation to prevent leaving your system in an inconsistent or broken state.
- How do I fix "The following packages have unmet dependencies"?
- This error occurs when apt tries to install a package but cannot find compatible versions of its required dependencies. Common causes include incompatible package versions, corrupted package cache, or held packages. Resolving it typically involves updating repositories, fixing broken packages, or removing conflicting packages.
- What causes "The following packages have unmet dependencies"?
- Package repositories contain incompatible versions of dependencies (especially with PPAs) Package cache is corrupted or contains stale metadata (requires apt cache refresh) Packages are held back using apt-mark hold, preventing upgrades or removals needed to resolve dependencies
- Is the "The following packages have unmet dependencies" error serious?
- It is a medium-severity error โ more of a blocker than a risk. The steps above resolve it.
Official resources & further reading
- ๐APT Official Documentation
- ๐ฌHow to fix broken packages - Ubuntu Community Hub(Stack Overflow)