How to fix dpkg: error processing package package-name (--configure): dependency problems - leaving unconfigured in APT
The "dependency problems - leaving unconfigured" dpkg error occurs when a package installation or upgrade is interrupted due to unmet dependencies. This prevents the package from being fully configured. Quick fix: run "sudo apt --fix-broken install" to resolve missing dependencies.
Quick fix
Fixes dpkg: error processing package package-name (--configure): dependency problems - leaving unconfigured
sudo dpkg --configure -a- Configure all pending packages first
- Fix broken dependencies with apt
- Clean the package cache and try again
- Check for specific errors in the configuration
sudo dpkg --configure -adpkg: error processing package package-name (--configure): dependency problems - leaving unconfigured
What this error means
This error happens when dpkg (Debian Package Manager) attempts to configure a package but encounters unmet dependency requirements. The package gets "half-installed"—its files are present but it's not fully functional. The error typically appears during package upgrades, when installing .deb files directly with dpkg, or when system updates are interrupted. Unlike apt, which resolves dependencies automatically, dpkg alone cannot fetch and install missing packages, leaving the system in an inconsistent state.
Typical symptoms
- Package commands fail with dpkg configuration errors
- apt upgrade or install operations hang or fail
- System cannot complete package updates
- Running any package management command shows pending configuration errors
- Specific packages appear in 'dpkg -l' output with status 'iH' (half-installed)
Common causes
- Installing a .deb file directly with 'dpkg -i' without first resolving its dependencies
- Interrupted package installation or upgrade (power loss, network disconnect, manual interruption)
- Missing library or dependency required by the package (e.g., libqt5printsupport5, kernel modules)
- Failed post-installation scripts due to disk space issues or missing utilities (e.g., mkinitramfs failure)
- Incompatible packages from different repositories or PPAs causing conflicts
- Corrupted dpkg database due to incomplete file system operations or disk errors
How to fix "dpkg: error processing package package-name (--configure): dependency problems - leaving unconfigured"
Run dpkg with the -a flag to attempt configuring all unconfigured packages:
sudo dpkg --configure -aThis forces dpkg to retry configuration for any packages left in an inconsistent state. Often this resolves the issue by itself if the dependencies are already installed.
If the first step doesn't work, use apt to install missing dependencies:
sudo apt --fix-broken installThis command tells apt to download and install any missing dependencies required by the problematic package, then reconfigure it. This is the most common solution.
Alternatively, use the legacy flag:
sudo apt-get install -fBoth commands do the same thing. Apt will show what it plans to install and ask for confirmation.
If the above steps don't work, clear apt's cache and retry:
sudo apt clean
sudo apt autoclean
sudo apt update
sudo apt --fix-broken installSometimes stale cache entries prevent proper dependency resolution. Cleaning and updating the package index can help.
If the error persists, see which package is actually failing:
sudo apt full-upgradeOr list packages in an inconsistent state:
dpkg -l | grep '^iH'The output shows which packages are half-installed. You can then manually inspect what went wrong for that specific package.
If the above steps fail, remove the package entirely and reinstall it:
# Remove the half-installed package
sudo apt remove package-name
# Reinstall it
sudo apt install package-nameOnly do this if you're sure the package isn't a critical dependency for your system. Removing the wrong package can break your system.
For kernel-related packages (linux-image, linux-headers), be especially careful—removing them can make the system unbootable.
Advanced notes
Understanding dpkg vs apt: dpkg is the low-level package tool that handles .deb files. It does not automatically fetch dependencies from repositories—it only manages files already present on the system. apt, conversely, resolves dependencies automatically by downloading them from configured repositories.
Always use 'apt' or 'apt-get' for normal package operations. Only use 'dpkg -i' directly when you have a specific .deb file and have already installed its dependencies via apt first.
If you install a .deb file with 'dpkg -i' instead of 'apt install ./package.deb', you'll encounter this error if dependencies are missing. The correct way is:
sudo apt install ./path/to/package.debThis tells apt to install the file while resolving its dependencies.
For persistent issues: If apt still cannot resolve the dependency, check:
- Are you using custom PPAs? They may have incompatible package versions.
- Is the package available in your enabled repositories? Check /etc/apt/sources.list and /etc/apt/sources.list.d/
- Is there a version mismatch? A newer package might depend on a library version not yet available in your repos.
Frequently asked questions
- What does "dpkg: error processing package package-name (--configure): dependency" mean?
- This error happens when dpkg (Debian Package Manager) attempts to configure a package but encounters unmet dependency requirements. The package gets "half-installed"—its files are present but it's not fully functional. deb files directly with dpkg, or when system updates are interrupted.
- How do I fix "dpkg: error processing package package-name (--configure): dependency"?
- The "dependency problems - leaving unconfigured" dpkg error occurs when a package installation or upgrade is interrupted due to unmet dependencies. This prevents the package from being fully configured. Quick fix: run "sudo apt --fix-broken install" to resolve missing dependencies.
- What causes "dpkg: error processing package package-name (--configure): dependency"?
- Installing a .deb file directly with 'dpkg -i' without first resolving its dependencies Interrupted package installation or upgrade (power loss, network disconnect, manual interruption) Missing library or dependency required by the package (e.g., libqt5printsupport5, kernel modules)
- Is the "dpkg: error processing package package-name (--configure): dependency" error serious?
- Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.
Official resources & further reading
- 📚APT Official Documentation
- 📖Debian Wiki: dpkg(Official Docs)
- 💬Ubuntu Forums: Dpkg Dependency problems(Stack Overflow)
- 💬Debian Forums: dependency problems - leaving unconfigured(Stack Overflow)