Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages
Servers, nginx and Docker

apt gives up with pkgProblemResolver generated breaks on Ubuntu

Your error

E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.2 more lines it can show

Fix it fast

Most common cause, 1 of 3

A dependency from another repository has a version the package rejects

Ask for the version the package needs by name, using package=version, in the same command as the package itself, so apt plans both at once.

Fix
sudo apt install libfoo=1.2-1 winehq-stable
Did this fix it?
Full steps for this cause: check, fix, verify

Short answer

On Ubuntu 24.04, apt 2.8 prints pkgProblemResolver::Resolve generated breaks when its resolver ends with a dependency it cannot satisfy. A hold is only one possible reason. Read the end of each unmet Depends line: a version from a PPA or vendor repository that the package rejects, a 32-bit package with no i386 architecture enabled, or a package held with apt-mark.

  • Applies to Ubuntu 24.04, apt 2.8, dpkg 1.22
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Which cause do you have?

Simulate the install, so apt prints its whole list of unmet dependencies without touching the system, and list any holds. The ending of each Depends line separates the causes: is to be installed means a version clash, it is not installable means apt has no candidate at all.

Run this first
apt-get install -s winehq-stable
apt-mark showhold

Then find the line you see in this list and open its fix:

  1. 1A dependency from another repository has a version the package rejectsDepends: libfoo (= 1.2-1) but 1.3-0ppa1 is to be installed
  2. 2A 32-bit dependency is needed but the i386 architecture is not enabledA Depends line on an :i386 package ending in but it is not installable
  3. 3A package really is on holdapt-mark showhold prints the package or one of its dependencies

What does the error look like?

  • E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
  • E: Unable to correct problems, you have held broken packages.
  • The following packages have unmet dependencies:

Cause 1 of 3

A dependency from another repository has a version the package rejects

You seeDepends: libfoo (= 1.2-1) but 1.3-0ppa1 is to be installed

Check

Generated breaks with a Depends line that ends in but <version> is to be installed means a dependency is already installed, or picked, at a version the new package does not accept, for example a newer build from a PPA or a vendor repository. apt-cache policy shows every version apt knows for that dependency and the source each one comes from.

Check
apt-cache policy libfoo

Fix

Ask for the version the package needs by name, using package=version, in the same command as the package itself, so apt plans both at once. If the other repository keeps pushing its build, remove that repository and run apt update.

Fix
sudo apt install libfoo=1.2-1 winehq-stable

Verify

apt-cache policy now shows the archive version of libfoo as installed, and the install ends without the resolver error.

Verify
apt-cache policy libfoo

Confirmed by manpages.ubuntu.com

Did this fix it?

Cause 2 of 3

A 32-bit dependency is needed but the i386 architecture is not enabled

You seeA Depends line on an :i386 package ending in but it is not installable

Check

Generated breaks with a dependency that ends in but it is not installable means apt has no candidate version for it at all. For a 32-bit library on 64-bit Ubuntu that is what happens when i386 was never added as a foreign architecture, since apt then has no i386 package lists to pick from.

Check
dpkg --print-foreign-architectures

Fix

Add the architecture, refresh the lists, and run the install again.

Fix
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install winehq-stable

Verify

dpkg --print-foreign-architectures prints i386, and the simulated install no longer lists unmet dependencies.

Verify
apt-get install -s winehq-stable

Confirmed by wiki.debian.org

Did this fix it?

Cause 3 of 3

A package really is on hold

You seeapt-mark showhold prints the package or one of its dependencies

Check

Generated breaks, this may be caused by held packages, points at a real hold only when apt-mark showhold lists the package or one of its dependencies; then the hold stops apt from changing a package the new install needs. A hold placed with apt-mark keeps the package from being installed, upgraded or removed automatically.

Check
apt-mark showhold

Fix

If nobody needs the hold any more, release it and repeat the install. If it was set on purpose, for example to keep a kernel or a database at one version, pick a version of the new package that fits the held one instead.

Fix
sudo apt-mark unhold libfoo
sudo apt install winehq-stable

Verify

apt-mark showhold no longer lists the package and the install goes through.

Verify
apt-mark showhold

Confirmed by manpages.ubuntu.com

Did this fix it?

How do I stop it coming back?

  • Before adding a PPA or vendor repository, run apt-cache policy on the libraries it ships to see which archive versions it would replace.
  • Remove PPAs you no longer use and run apt update, so their library builds stop overriding the Ubuntu archive.
  • Keep a note of every apt-mark hold with its reason, and read apt-mark showhold before a release upgrade.
  • Add the i386 architecture before installing software whose packages pull in :i386 libraries.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.