Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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:
   php5-mysqlnd

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.