Unable to fix broken packages with sudo apt-get install -f

Solution 1:

http://www.iasptk.com/ubuntu-fix-broken-package-best-solution

After trying

sudo dpkg --configure -a

and

sudo apt-get install -f

the problem of a broken package still exist the solution is to edit the dpkg status file manually.

sudo -i gedit /var/lib/dpkg/status

(you can use vi or nano instead of gedit)

Locate the corrupt package, and remove the whole block of information about it and save the file.