How to Fix Broken Dependencies on Linux

Resolve broken dependencies on Linux and clean stale package cache and leftovers with Kudu.

By Kudu Team

Fix this automatically with Kudu

Run a free system scan to detect and resolve this issue automatically — no manual steps required.

Download Kudu Free →

What Causes This?

Broken dependencies on Linux usually happen when a package installs, upgrades, or removes only part of what another package needs. This can be caused by interrupted updates, mismatched software repositories, manually installed .deb or .rpm files, or old package cache data that conflicts with newer versions. In some cases, leftover package metadata or partially removed packages keep the package manager stuck in an inconsistent state.

Common Symptoms

  • App installs fail with dependency or unmet package errors
  • Software updates stop partway through or refuse to start
  • The package manager reports broken, held, or partially installed packages
  • You see messages about missing libraries or version conflicts
  • Old package files and leftovers keep taking up disk space

How to Fix It Manually

  1. Back up important files first

    • Before making package changes, save any important work.
    • If you're using a Linux VM or dual-boot setup on your Windows PC, create a restore point or snapshot if available.
  2. Open a terminal

    • On most Linux desktops, press Ctrl+Alt+T.
    • If that doesn't work, open the app launcher and search for Terminal.
  3. Refresh package lists

    • On Debian-based systems like Ubuntu, run:
      sudo apt update
    • This updates your local package index so the system can find the correct versions.
  4. Try repairing broken packages

    • Run:
      sudo apt --fix-broken install
    • Then finish any incomplete package setup:
      sudo dpkg --configure -a
    • If a package is stuck, remove it:
      sudo apt remove package-name
      Replace package-name with the actual package causing the error.
  5. Clean stale package cache and unused files

    • Remove cached package files that may be outdated:
      sudo apt clean
    • Remove packages that were installed as dependencies but are no longer needed:
      sudo apt autoremove
    • This helps clear out leftovers that can contribute to conflicts.
  6. Check for held or conflicting packages

    • List held packages:
      apt-mark showhold
    • If needed, unhold a package:
      sudo apt-mark unhold package-name
    • Held packages can block upgrades and create dependency chains that never resolve properly.
  7. Verify your software sources

    • If the issue started after adding a third-party repository, disable it and update again.
    • On Ubuntu, you can open Software & Updates from the app menu and review the Other Software tab.
    • Then run:
      sudo apt update
      sudo apt upgrade
    • Mixing incompatible repositories is a common cause of dependency problems.
  8. Reboot and test installs again

    • Restart the system after repairs:
      sudo reboot
    • After rebooting, try the failed install or update again to confirm the dependency issue is gone.

Fix It Automatically with Kudu

If you don't want to sort through package leftovers, stale cache, and failed dependency cleanup by hand, Kudu can help automate the cleanup process. It can detect junk files, remove stale package cache and leftovers, and make it easier to recover disk space and reduce clutter after package problems.

Download Kudu Free →

Fix this automatically with Kudu

Run a free system scan to detect and resolve this issue automatically — no manual steps required.

Download Kudu Free →