I have an error with either installing apps through Software Center or apt-get.

Reading package lists... Done
Building dependency tree       
Reading state information... Done
seahorse is already the newest version.
The following packages were automatically installed and are no longer required:
  language-pack-zh-hans language-pack-kde-en language-pack-kde-zh-hans
  language-pack-kde-en-base kde-l10n-engb kde-l10n-zhcn
  language-pack-zh-hans-base firefox-locale-zh-hans
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 13 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up mysql-server-5.5 (5.5.24-0ubuntu0.12.04.1) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)
I have installed xampp which at first didn't worked. The mysql service didn't want to start or stop. I then uninstalled xampp, tried to install mysql server and a client from Software Center. It didn't complete (install errors). I then removed them, restarted and reinstalled xampp. This time it worked (that is my sql, php etc).

However, since then, whenever I install an app, either through the Software Center or apt-get, I get an error that a previous package was not installed fully and the installed app is not available.

How can I fix this error and starting using my apps?