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 showFix it fast
Most common cause, 1 of 3A 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.
sudo apt install libfoo=1.2-1 winehq-stableShort 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.
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.
apt-get install -s winehq-stable
apt-mark showholdThen find the line you see in this list and open its fix:
- 1A dependency from another repository has a version the package rejects
Depends: libfoo (= 1.2-1) but 1.3-0ppa1 is to be installed - 2A 32-bit dependency is needed but the i386 architecture is not enabled
A Depends line on an :i386 package ending in but it is not installable - 3A package really is on hold
apt-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.
apt-cache policy libfooFix
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.
sudo apt install libfoo=1.2-1 winehq-stableVerify
apt-cache policy now shows the archive version of libfoo as installed, and the install ends without the resolver error.
apt-cache policy libfooConfirmed by manpages.ubuntu.com
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.
dpkg --print-foreign-architecturesFix
Add the architecture, refresh the lists, and run the install again.
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install winehq-stableVerify
dpkg --print-foreign-architectures prints i386, and the simulated install no longer lists unmet dependencies.
apt-get install -s winehq-stableConfirmed by wiki.debian.org
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.
apt-mark showholdFix
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.
sudo apt-mark unhold libfoo
sudo apt install winehq-stableVerify
apt-mark showhold no longer lists the package and the install goes through.
apt-mark showholdConfirmed by manpages.ubuntu.com
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.