🔍
Artificial Intelligence Cybersecurity Windows Mac Android iPhone Software How-To Guides Reviews Comparisons Productivity Internet Apps Cloud Business Software About Contact

How to Fix "You Have Held Broken Packages" Error in Linux

The "You have held broken packages" error is one of the most frustrating Linux package manager errors. It means the package you are trying to install conflicts with another package or has unmet version requirements. Here is how to fix it.

Understanding the Error

This error is different from "unmet dependencies". It means APT has determined that installing the package would break your system in some way. This often happens when mixing repositories from different Ubuntu versions or adding PPAs that are not compatible with your release.

Fix 1: Run apt --fix-broken Install

Start with the standard fix: sudo apt --fix-broken install. This command tells APT to repair any broken packages automatically. It may suggest removing conflicting packages or installing missing dependencies. Review the changes APT proposes before confirming.

Fix 2: Check and Manage Held Packages

List held packages with apt-mark showhold. If a package is held at a specific version, it may conflict with software you are trying to install. Unhold it with sudo apt-mark unhold packagename. After unholding, run sudo apt upgrade to update all packages to compatible versions.

Fix 3: Remove Conflicting PPAs

PPAs are a common source of broken packages. List your PPAs with ls /etc/apt/sources.list.d/. If you recently added a PPA that might be causing conflicts, remove it with sudo add-apt-repository --remove ppa:name. Then run sudo apt update and try your installation again.

Fix 4: Downgrade Conflicting Packages

If a specific package version is causing the conflict, you can downgrade it. Install the previous version with sudo apt install packagename=version. Find available versions with apt-cache policy packagename. After downgrading, hold the package at that version with sudo apt-mark hold packagename to prevent accidental upgrades.