How to Fix ‘Unable to Correct Problems, You Have Held Broken Packages’ in Ubuntu

When maintaining an Ubuntu system, few terminal messages cause as much immediate frustration as the notorious error: E: Unable to correct problems, you have held broken packages. This error typically surfaces when running sudo apt install or attempting system upgrades after adding third-party repositories, installing proprietary drivers, or changing desktop environments.

Unlike standard package missing notifications, this error indicates a structural dependency deadlock. The Advanced Package Tool (APT) detects conflicting package dependencies where fulfilling the installation of one library would break an existing package that the system has explicitly been instructed—or implicitly compelled—not to modify. Resolving this issue does not require reinstalling your operating system; instead, methodical troubleshooting will untangle conflicting repositories and dependency locks.

Why the Held Broken Packages Error Occurs in Ubuntu

To safely resolve the error, it is helpful to understand the underlying mechanisms that trigger APT’s dependency refusal. APT prioritises overall system stability above individual package installations. When a deadlock occurs, it is usually driven by one of four common root causes:

  • Explicit Package Holds: A package or library was previously pinned or locked at a specific version using apt-mark hold to prevent automatic updates, preventing newer dependent packages from installing.
  • Mismatched Third-Party PPAs: Adding Personal Package Archives (PPAs) designed for a different Ubuntu release (for instance, using a Noble Numbat PPA on a Jammy Jellyfish installation) forces dependency versions out of alignment with canonical repositories.
  • Obsolete or Broken Dependencies: Residual configuration files or partially installed packages from aborted upgrades can leave the local DPKG status database in an inconsistent state.
  • Strict Version Pinning in APT Preferences: Custom configuration files inside /etc/apt/preferences.d/ might enforce strict release pinning rules that prevent essential shared libraries from updating.

Step 1: Identify and Release Explicitly Held Packages

The first diagnostic step is checking whether any packages on your Ubuntu installation have been placed on hold. When a package is held, APT refuses to upgrade or replace it, even if a newly requested application requires a newer version of that exact dependency.

Execute the following command in your terminal to list all held packages:

apt-mark showhold

Alternatively, you can query the lower-level DPKG database:

dpkg --get-selections | grep hold

If the terminal outputs one or more package names (such as specific kernel modules, graphics drivers, or core libraries like libssl), those holds may be causing the conflict. To unhold a conflicting package, run:

sudo apt-mark unhold <package-name>

Once unheld, update your local repository index and attempt the installation again:

sudo apt update && sudo apt install <desired-package>

Step 2: Resolve Dependency Deadlocks Using Aptitude

Standard apt is conservative: when it encounters a version conflict between two dependencies, it refuses to make unilateral decisions and simply halts with the “held broken packages” error. In contrast, Aptitude includes an advanced dependency resolution engine that calculates multiple viable scenarios, such as downgrading specific secondary packages or choosing alternative library builds.

If Aptitude is not installed on your system, install it using:

sudo apt install aptitude

Next, use Aptitude to install the package that previously triggered the error:

sudo aptitude install <package-name>

Aptitude will evaluate the package graph and present a suggested resolution. Pay close attention to its prompt:

  • The First Proposal: Aptitude’s first suggestion is almost always to leave the conflicting package uninstalled (answering N or rejecting it). Type n and press Enter to prompt Aptitude for the next alternative solution.
  • Alternative Proposals: Aptitude will subsequently propose downgrading specific conflicting libraries or removing minor incompatible utilities to satisfy the dependency chain.
  • Accepting a Safe Solution: Once Aptitude displays a solution that upgrades or downgrades necessary dependencies without removing core system packages, type y and press Enter to proceed.

Step 3: Remove Conflicting PPAs and Clean Repository Lists

Third-party PPAs and external software repositories are the most frequent cause of unresolvable package dependencies. When an external repository provides newer versions of foundational system libraries (such as GLib, Python, or Mesa) that conflict with Ubuntu’s official repositories, APT cannot safely proceed.

To inspect your configured third-party repositories, review the contents of the sources directory:

ls -la /etc/apt/sources.list.d/

If a recently added PPA triggered the problem, purge it completely using ppa-purge. This tool not only disables the repository but also safely downgrades all installed packages from that PPA back to official Ubuntu versions:

sudo apt install ppa-purge
sudo ppa-purge ppa:<repository-owner>/<ppa-name>

If you configured the repository manually using a modern .sources file in Ubuntu 22.04 or 24.04, remove or disable the file and refresh your package lists:

sudo rm /etc/apt/sources.list.d/<problematic-repo>.sources
sudo apt update

Step 4: Clean APT Cache and Repair Incomplete Installations

Corrupted metadata in the local package cache can cause APT to miscalculate package availability. Clear out cached archive files and force the package manager to repair broken dependencies:

sudo apt clean
sudo apt autoclean
sudo apt --fix-broken install
sudo dpkg --configure -a

The --fix-broken install switch commands APT to scan the system for missing dependencies and attempt to resolve them immediately. The dpkg --configure -a command finishes configuring any packages whose post-installation scripts were interrupted.

Diagnostic and Resolution Commands Comparison

The table below provides a quick reference for the primary tools used to diagnose and resolve package conflicts in Ubuntu:

Tool / Command Primary Function Recommended Scenario
apt-mark showhold Lists explicitly pinned packages Initial triage when packages refuse to update
sudo aptitude install Interactive multi-scenario dependency solver Complex version conflicts between libraries
sudo ppa-purge Removes PPA and downgrades packages to stock Conflicts introduced by third-party PPAs
sudo apt --fix-broken install Repairs incomplete or missing dependencies Post-upgrade failures or interrupted installs

Preventing Dependency Collisions on Ubuntu

To prevent future occurrences of the “held broken packages” error, adhere to best practices when managing software sources. Avoid adding unofficial PPAs intended for newer or older Ubuntu releases, and refrain from blindly editing /etc/apt/sources.list with instructions found in generic Debian forums. When working with cutting-edge tools or proprietary developer SDKs, consider using containerised environments or official Flatpaks and Snaps, which bundle their own dependencies and insulate your foundational operating system libraries from conflicting updates.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.