Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

After freshly installing Ubuntu server 12.04, I did the usual apt-get update / apt-get upgrade, which failed for mysql-server-5.5:

Setting up mysql-server-5.5 (5.5.31-0ubuntu0.12.04.2) ...
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
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.5; however:
  Package mysql-server-5.5 is not configured yet.
dpkg: error processing mysql-server (--configure):
 dependency problems - leaving unconfigured

I tried a wide variety a approaches suggested by googling, which involved various combinations of apt-get remove/purge/install -f/reinstall, etc., with no luck. I also tried downloading the package directly from and running dpkg -i on it (this had worked for a similar issue with a kernel upgrade), but to no avail.

I'm not actually particularly interested in what's going on with mysql, per se (though I will need to figure it out at some time); at this point, my primary concern is that I am unable to apt-get install other packages!

What to do?

share|improve this question

Something is preventing mysql from starting. Maybe there is an old mysql process still running? You could try manually starting mysqld_safe or safe_mysqld and check the logs for any errors.

share|improve this answer
up vote 0 down vote accepted

Most of the answer I got here:

edit /var/lib/dpkg/info/mysql-server-5.1.postinst and remove the part where it starts the server (probably calling /etc/init.d/mysql-server start or so), then launch dpkg --configure -a to finish the installation process and then fix your configuration.

However, this didn't quite do the job; I had to run dpkg --configure mysql-server-5.5 prior to dpkg --configure -a.

Although mysql still won't start, that's a separate problem; I am able to install and update other packages now, which was my main concern.

share|improve this answer

Had this same problem and tried various incantations of apt, aptitude, purge, remove, reinstall, install and even tried reinstalling after a purge and moving the /var/lib/mysql > /var/lib/mysql.old along with /etc/mysql > /etc/mysql.old. Nothing.

There appears to be some conflict with AppArmor and the latest mysql-server-5.5 patch on ubuntu 12.04. There is a bug report on it here. Perfect fix:

Basically, remove the AppArmor package and dpkg should see your mysql-server-5.5 package as being unconfigured. With AppArmor out of the way, mysql can start correctly and resume it's patching operation. After mysql has been configured by dpkg, install the AppArmor again and all should be well.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.