Just read the error. It tells you what you need to do.
subprocess pre-removal script returned error
This means a script is getting in your way, this pre/post install scripts are stored in /var/lib/dpkg/info. You can find the scripts related to a specific package with :
ls /var/lib/dpkg/info | grep "package"
where "package" is the name of the program you want to remove (without brackets).
In your case it is
Quote:
/var/cache/apt/archives/mysql-server-5.1_5.1.41-3ubuntu12.3_i386.deb
|
which is the culprit.
So google how to remove something using apt-get commands and learn how to remove
mysql-server-5.1