This error occurs when APT detects a circular dependency involving Pre-Depends declarations, preventing it from determining the correct installation order. It typically happens during upgrades when multiple packages have strict pre-dependency requirements on each other.
When APT encounters this error, it means there's a circular dependency chain involving Pre-Depends declarations. Pre-Depends is a stricter form of dependency that forces dpkg to complete installation of the depended-on package before even unpacking the dependent package. A cycle occurs when Package A pre-depends on Package B, which (directly or indirectly) pre-depends on Package A, creating an impossible installation order. This is fundamentally a packaging issue—the maintainers have created packages with incompatible Pre-Depends declarations. APT cannot resolve this automatically because there is no valid order to satisfy all constraints.
Run the command that triggered the error and note the exact package names from the error message.
sudo apt-get upgrade
# or
sudo apt-get install <package>The error output will show: "Couldn't configure pre-depend X for Y" — X and Y are your problematic packages.
Install the pre-dependency package (X in the error) independently. This often breaks the cycle because APT can configure it before attempting the dependent package.
sudo apt-get install <pre-depend-package>After this succeeds, retry your original operation:
sudo apt-get upgrade
# or
sudo apt-get install <original-package>If the manual approach doesn't work, try dist-upgrade which uses a more sophisticated dependency resolver:
sudo apt-get dist-upgradeNote: dist-upgrade will remove packages with unmet dependencies if necessary, so review the output carefully before confirming.
If apt remains stuck, complete any pending dpkg configuration:
sudo dpkg --configure -aThen retry apt operations:
sudo apt-get install -fIf all else fails and both packages are marked as "essential", you can tell APT to temporarily break the cycle by removing one package, then re-installing it:
echo 'APT::Force-LoopBreak "true";' | sudo tee -a /etc/apt/apt.conf.d/99-force-loopbreakThen retry:
sudo apt-get install -fWARNING: This option should only be used for critical system packages. Creating this configuration tells APT it's acceptable to temporarily remove essential packages to break cycles. Afterward, remove this configuration:
sudo rm /etc/apt/apt.conf.d/99-force-loopbreakThis error is fundamentally a packaging quality issue, not a user error. Pre-Depends should be used sparingly—the Debian Policy Manual actively discourages their use and recommends consulting debian-devel before adding them. If you encounter this error, the preferred long-term solution is to report it to the package maintainers on the Debian or Ubuntu bug trackers, as the underlying cause is in the package declarations, not your system. Common affected packages include multiarch libraries (libc6-i386, lib32stdc++6), language packs, and packages with complex post-installation scripts. Most cycles are eventually fixed upstream. If you're in a development/CI environment, you may also consider pinning specific package versions or using containers with known-good package versions until the cycle is resolved.
dpkg: serious warning: files list file for package 'package-name' contains empty filename
How to fix "files list file contains empty filename" in APT
E: Sub-process /usr/bin/dpkg returned an error code (2)
How to fix "Sub-process /usr/bin/dpkg returned an error code (2)" in APT
dpkg-divert: error: rename involves overwriting 'path' with different file
How to fix dpkg-divert rename conflicts in APT
E: Sub-process /usr/bin/dpkg returned an error code (1) during kernel installation
How to fix "dpkg returned an error code (1)" in APT kernel installation
dpkg: dependency problems prevent configuration of triggers
dpkg: dependency problems prevent configuration of triggers in apt