22

In this case I have the libgbm1 being held, giving me message like:

Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

Since I carefully read How do I resolve unmet dependencies after adding a PPA? I tried to remove the broken package with sudo apt-get remove libgbm1 as suggested. However, remove command gave me the same error.

sudo apt-get upgrade doesn't upgrade this package ("...and 1 not upgraded."). And I need this one to build some other packages that depends on it (pkgProblemResover problem again). It seems I cannot revert the version nor move forward.

Steps I've ever tried:

  • disabling some ppa repositories in software updates and sudo apt-get update then tried to fix with apt, which didn't work.
  • sudo apt-get -f install with and 1 not upgraded.
  • tried to install packages that libgbm1 depends on. But more packages coming forward and quickly piles up to tens of them, which seems unreliable to handle, and they also reported similar errors.

Why couldn't I remove the package? How to fix it?

3 Answers 3

38

The problem here is to lock down the trouble maker package and kick it out. Then you can fix inconsistent dependencies with sudo apt-get -f install.

So with cautious you may use: sudo dpkg --force-all -P libgbm1 to force removing the broken. This command may damage your system, so you should watch it. And try to fix: sudo apt-get -f install.

If any packages are corrupting as well, repeat above steps cautiously. And each time you removed broken packages, try to fix them. I tackled my problem in this case.

2
  • Thank you, two days of pain before to find your answer! However I have to complete your answer because I had to run sudo apt --fix-broken install after sudo dpkg --force-all -P libgbm1 to finish the install Jul 12, 2018 at 8:45
  • Thank you sudo dpkg --force-all -P <package> was the solution for my problem.
    – deadfish
    Sep 29, 2021 at 13:33
15

Instead of rushing to remove your broken packages using the --force-all option of dpkg, first try removing it without this option, using simply

dpkg -P package-name

In my case, dpkg printed why it couldn't remove this package: another package depended on it. After I removed the dependee, the broken package could finally be removed, without any --force-anything.

This may require several recursive removals in case when the dependee is also broken, but the end result should be fixing the dependency chain, which apt was unable to fix, by removals.

2
  • 1
    This was the only solution I could find that worked to help me with my problem, unable to install because of unmet dependencies
    – wlh
    Feb 20, 2019 at 22:35
  • You can delete the dependencies of dependencies recursively as well!
    – WhaSukGO
    Oct 26 at 10:17
1

Force Reconfigure or Remove Broken Packages with DPKG

Reconfigure DPKG, the base package management system, with the following command:

sudo dpkg --configure -a

Check if DPKG marked some packages as needing a reinstall.

sudo dpkg -l | grep ^..R

If the command above returns a list of one or more packages, try removing the packages by typing:

sudo dpkg --purge --force-all libgbm1

After you finish troubleshooting, run the following command to clean up the system:

sudo apt clean

Then update the repositories:

sudo apt update

Then upgrade the repositories:

sudo apt upgrade

Hope it helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.