How to reinstall a apt-get dist-upgrade?

For broken packages

sudo dpkg --configure -a

and

sudo apt-get install -f

Reinstall package

sudo apt-get install --reinstall <package name>

Note

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

sudo nano /var/lib/dpkg/status

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