I Tried to Upgrade My System, but I Get an Error

If you try to install some software or upgrade your computer, and you get an error, the package manager may have tied itself in a knot. To try and resolve this, open a terminal, and run the following commands:

foo@bar:~$ sudo apt-get update
foo@bar:~$ sudo apt-get -f install

The first command updates your package list, and the second command tries to fix your package manager. If this is successful the packages that failed will be installed correctly.
In addition to these commands, you can reconfigure any packages that have not yet been configured by running:

foo@bar:~$ sudo dpkg -configure -pending