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 launchpad.net 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?


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.


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.


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: https://bugs.launchpad.net/ubuntu/+source/mysql-5.5/+bug/1276229

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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