Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

I'm on an Ubuntu 11.10 server with PHP 5.4 installed from a PPA. I had the MySQL library installed (php5-mysql) but wanted to try out the native driver (php5-mysqlnd), so I ran sudo apt-get install php5-mysqlnd. It caused some errors with dpkg, so I tried to remove it:

$ sudo apt-get remove php5-mysqlnd
Removing php5-mysqlnd ...
dpkg: error processing php5-mysqlnd (--remove):
  subprocess installed pre-removal script returned error exit status 1
Processing triggers for libapache2-mod-php5 ...
  * Reloading web server config apache2
Errors were encountered while processing:

When I first installed php5-mysqlnd, it uninstalled php5-mysql--and now I can't reinstall that, as it tries to remove php5-mysqlnd. Now I'm left without a way to connect to my MySQL server in PHP.

How can I fix this problem? I've tried forcefully removing php5-mysqlnd (as per php5-mysqlnd on debian wheezy/sid?), but that gives the same exact error.

share|improve this question
up vote 2 down vote accepted

sudo rm /var/lib/dpkg/info/php5-mysqlnd.prerm

This allowed me to install php5-mysql again. Modified from How to fix broken synaptic updates

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.