I have made a script for fixing broken packages. This searches for the broken packages in the /var/log/dist-upgrade/apt.log and then finds the package names then applies the specified command on them.
Take care about using this script, because sometimes some broken packages are system related and might make a new problem. so use install or upgrade command instead of remove command.
Get it from here
Download the script using the below command:
wget https://gist.githubusercontent.com/EmpireWorld/8eb920165777399cfd684d8d4227a6e2/raw/17e6d4a151a6163aa45dd8302b965ed433b27741/fix-broken.sh
Then run it:
./fix-broken.sh
Also you can set the action you want to apply to broken packages like this:
./fix-broken (install|upgrade|remove)
The default action is remove.