From GitHub Gists
APT - Dependency Errors Fix
Setting the Stage
One night, I attempted to use the
APT: Package Manager—which I've successfully done thousands of times before—and I ran into a metric-f-ton™️ of dependency errors that halted the installation like the snail-crawl-parking-lot-exodus©️ after a NFL game or Shania Twain concert.After repeatedly punching 👊 my keyboard and 🖥️ while rapidly uttering expletives in my "OUTSIDE" voice, I took a deep breath and set out to show
APTwho's boss.Below, I've recorded in painstaking detail my steps to salvation and the road back to sanity. My hope is this will help someone else who finds themselves on the loosing end of a automatic package upgrade that 💩 its own pants near completion.
TL;DR - The Short Answer
CAUTION: This could severely damage your OS's stability or make it inoperable altogether.
make sure to have a working backup ready to restore to in case of emergency!
All the typical suggestions didn't work for me. Here's a list of what I tried in no particular order:
$> sudo apt-get --fix-broken|f install #fail $> sudo apt purge [broken-package] #fail again $> sudo apt remove [broken-package] #3rd times a fail $> sudo apt --fix-broken install #futility unchecked $> sudo dpkg -r [broken-package] #definition of insanity $> sudo apt --fix-broken --allow-unholy-hell-to-be-released #again? $> small-animal-sacrifices #understandable $> large-animal-sacrifices #starting-to-escalate-a-bitI tried the above commands hundreds of times and crossing every
possible permutation of fingers and toes. None of it worked. Until I did this...
$> sudo apt-get purge [broken-package] #fail blah blah: unmet dependcy errors: - [broken-packageA]: depends on [some-other-packageB] $> sudo apt-get purge [broken-packageA] [some-other-packageB]...[some-other-packageZ] #improved failure
It took SEVERAL attempts of adding all of the listed unmet dependencies to my
apt purgecommand, but every time I added another listed dependency issue package name, the reported list of dependency errors shrank.
This is in essence the solution to my particular problem. Attempt to run an
apt removeor anapt purgeon your broken package. Review the list of dependency issues (i.e. apps that depend on the package you're removing) and add that package-name to your list ofapt remove --purge app1 app2 app3 ... appNpackages until the command actually runs and executes.If you get a partial execution with some additional failures/dependcy errors, just repeat the process with the listed problem packages.
Afterwards, run an
apt autoremove && apt autoclean && apt update && apt dist-upgrade && apt full-upgradeetc. until your system is clean and reporting no more errors.
...
For all the gory details, read on for the full-blown snooze-fest in GitHub Gist format here GitHub - Gist - APT Dependency Error Recovery
Continues in GitHub Gist format here: GitHub - Gist - APT Dependency Error Recovery
 
                