

It is the nightmare of every Linux administrator and enthusiast: You run a simple sudo apt-get install, and instead of a progress bar, you are met with a wall of text ending in: "E: Unable to correct problems, you have held broken packages."
In the world of Debian-based systems (like Ubuntu, Mint, and Kali), the Advanced Package Tool (APT) is your system's librarian. When you ask for a piece of software, APT checks a massive index of dependencies. If Package A requires Version 2.0 of a library, but your system is strictly holding onto Version 1.0, APT hits a "deadlock."
Unlike a standard "Package not found" error, the "Held Broken Packages" message is unique. It means APT has tried to find a solution—perhaps by upgrading or downgrading other files—but the internal logic rules (constraints) you or your software sources have set prevent it from making those changes.
When you see this error, it usually lists specific packages. For example:
The following packages have unmet dependencies:
package-name : Depends: library-name (>= 2.3) but it is not going to be installed
This output is the key to your solution. It tells you exactly which "bridge" is broken. Over the next 2,000 words, we will explore every single method to repair this bridge, ranging from "Soft Resets" to "Surgical Package Removal."
When you encounter the "Held Broken Packages" error, your first instinct might be to start deleting things. Stop. Before we perform surgery on your package manager, we need to create a recovery point.
Most "Broken Package" errors are caused by conflicting repositories (PPAs). If we accidentally corrupt our sources list, your system won't know where to download any software. Run this command to create a timestamped backup of your sources:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
To fix the error, you must understand the difference between the Package Cache and the Package Database.
.deb files you've already downloaded. Sometimes these files are corrupted during the download process.sudo apt-get update before trying a fix. This doesn't install anything; it simply ensures your local database matches the latest version available on the Ubuntu servers.
One reason you might have "held" packages is that a standard upgrade command is forbidden from adding or removing new packages. It can only update what you already have.
If a package requires a new dependency to be installed, apt-get upgrade will "hold" that package back to keep your system stable. This is often where our error message originates.
Now that your system is backed up, we begin the repair process. Often, the "Held Broken Packages" error is just a temporary glitch in the package manager's "planning" phase. We can solve this by clearing the slate.
The -f (or --fix-broken) flag is your primary tool. It tells APT to ignore the current error and attempt to fix the underlying broken dependencies automatically by downloading missing pieces or removing conflicting ones.
sudo apt-get install -f
Pay close attention to the output. If it asks for confirmation (Y/n), read which packages are being removed. If you see your entire desktop environment (like ubuntu-desktop or gnome) in the "To Be Removed" list, stop immediately.
Sometimes, the .deb file sitting in your local folder is corrupted. Even if you run a fix, APT keeps trying to use that broken file. We need to empty the "download folder" of the package manager.
sudo apt-get clean
sudo apt-get autoclean
After cleaning the cache, we must force Ubuntu to rebuild its index of available software. This ensures that the "Broken Packages" error isn't caused by your computer looking for a version of a file that no longer exists on the server.
sudo apt-get update --fix-missing
The --fix-missing flag is a life-saver if you have a spotty internet connection or if some mirror servers are down.
If you are still seeing "Unable to correct problems," it is because the standard apt logic is too rigid. It sees a conflict and simply stops. Aptitude, however, is designed to find multiple paths forward. It will suggest downgrading certain files or removing specific blockers to make your desired installation work.
Aptitude is often not installed by default on modern Ubuntu systems. Since your package manager is "broken," we have to hope the core system can still fetch this one utility:
sudo apt-get install aptitude
Once installed, run the installation of your problematic package using aptitude instead of apt:
sudo aptitude install [package-name]
Aptitude will offer you a series of "Solutions." It is a conversation:
Standard APT is programmed to be "safe"—it refuses to remove anything unless explicitly told. Aptitude, however, uses a cost-based algorithm. It calculates different scenarios (Solution A, B, and C) and presents them to you. This is the most effective way to break a "dependency loop" where Package A needs B, but B is blocked by C.
Example: If you are trying to install a new version of VLC but it requires an older version of a video codec already in use by another app, Aptitude will offer to downgrade that codec so VLC can function.
Ubuntu allows users and software installers to "hold" a package. This prevents the package from being updated, which is great for stability—until you try to install something new that requires that update. This creates a "Deadlock" that APT cannot break on its own.
First, we need to see if there are any packages explicitly set to "hold." Use the following command to generate a list:
dpkg --get-selections | grep hold
If this returns any results, you've found your culprits. You must "unhold" them to allow the package manager to do its job:
sudo apt-mark unhold [package-name]
PPAs (Personal Package Archives) are the most common cause of the "Unable to correct problems" error. A PPA might offer a version of a core library (like libc6 or openssl) that is newer than the official Ubuntu version. When you try to install official software later, the versions don't match.
Instead of just deleting a PPA, you should "purge" it. Purging removes the PPA and downgrades all packages installed from that PPA back to the official Ubuntu versions.
sudo apt-get install ppa-purgesudo ppa-purge ppa:repository-name/subdirectoryIf you prefer a GUI (Graphical User Interface), you can manage these through "Software & Updates":
If you have reached this stage and are still seeing the "Unable to correct problems" error, the issue is likely a corruption in the DPKG status database. While APT is the high-level manager, DPKG is the worker that actually moves files. If the worker's ledger is torn, the manager cannot make decisions.
Our first move is to tell the system to re-read every installed package and attempt to finish any "half-configured" installations that might be blocking the queue.
sudo dpkg --configure -a
The -a stands for "all." This command searches for any software that started installing but never finished. Often, this "unblocks" the hold that was preventing your other packages from installing.
Sometimes the reason you "have held broken packages" is because a previous process crashed and left behind a "lock" file. This file tells the system: "I'm busy, don't let anyone else touch the packages." If that process is dead, the lock remains, and APT becomes paralyzed.
sudo rm /var/lib/apt/lists/locksudo rm /var/lib/dpkg/lock-frontendsudo rm /var/cache/apt/archives/lockIf the package list itself is corrupted, we can delete the local copies and force Ubuntu to download a 100% fresh set of instructions from the servers.
sudo rm -rf /var/lib/apt/lists/* sudo apt-get update
This is a "refresh" for your system's brain. After running this, the "Unable to correct problems" error often disappears because the conflict was based on outdated or misaligned index data.
They say an ounce of prevention is worth a pound of cure. In Linux administration, this couldn't be truer. Most "Held Broken Package" errors are self-inflicted through aggressive customization. Here is how to keep your system pristine.
A "FrankenUbuntu" system is created when a user adds repositories from different versions of Ubuntu (e.g., adding a Focal Fossa PPA to a Jammy Jellyfish system) or, worse, adding Debian repositories to Ubuntu.
lsb_release -c. Ensure every PPA you add matches that codename exactly.
Many users make the mistake of using dist-upgrade or full-upgrade every single day. While these commands are powerful, they are allowed to remove packages to satisfy new dependencies.
sudo apt update && sudo apt upgrade. This is conservative and safe.sudo apt full-upgrade only when you are prepared for major system changes.If you find that a specific piece of software (like an obscure video editor or a specific development tool) always causes dependency conflicts, consider using a Snap or Flatpak version.
Unlike standard .deb packages, Snaps and Flatpaks carry their own libraries. They don't touch your system's core libc6 or python versions, meaning they cannot cause "Held Broken Package" errors.
Fixing the "E: Unable to correct problems, you have held broken packages" error is a rite of passage for Ubuntu users. By following this guide, you’ve moved from basic force-fixes to advanced database surgery.
| Scenario | Recommended Command |
|---|---|
| Minor Glitch | sudo apt-get install -f |
| Complex Conflicts | sudo aptitude install [package] |
| Corrupted Cache | sudo apt-get clean && sudo apt-get update |
| Locked Database | sudo dpkg --configure -a |
Generally, no. Lock files exist to prevent two programs from modifying your system at the same time, which could lead to a catastrophic crash. You should only delete them if you are 100% sure that no other update process is running. Always try sudo killall apt apt-get before resorting to rm.
This is actually a safety feature! Sometimes an update requires the removal of an existing package or the installation of a completely new dependency. A standard apt upgrade is not allowed to do this. When this happens, use sudo apt full-upgrade to allow the package manager to make those necessary changes.
While rarely the direct cause of a boot failure, broken packages can prevent critical security updates from being installed. If a core library (like libc6) is left in a "half-installed" state, your system may become unstable. This is why fixing the error immediately is highly recommended.
Think of DPKG as the "tools" and APT as the "manager." DPKG does the manual labor of unpacking files, while APT handles the "thinking"—deciding which versions to download and where to get them. Most "Unable to correct problems" errors are APT failing to find a logical path forward.
If all else fails, you may have a Release Mismatch. Verify that your /etc/apt/sources.list doesn't have two different Ubuntu versions listed (e.g., both "Focal" and "Jammy"). If it does, comment out the older version, run sudo apt update, and try the fix again.