update-rc.d: error: insserv rejected the script header
dpkg: error processing package mysql-server-5.7 (--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.7; however:
  Package mysql-server-5.7 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

This error is coming while installing this. I am using the following command to install:

sudo apt install mysql-server

I have also tried purging/removing the complete package, starting and stopping services, autoclean, autoremove. Everything. Kindly help me in installing mysql-server and client.


try removing it with following commands:

sudo apt-get --auto-remove purge mysql\*
sudo apt-get -f install
sudo apt-get --auto-remove purge mysql\*
sudo rm -rf /etc/mysql* /var/lib/mysql* /usr/share/mysql* /var/log/mysql
sudo apt-get clean

see if it was cleaned up properly

sudo updatedb
locate mysql

and scan the output for folders, packages or files left over from the uninstalling.

after making sure those are gone, too, re-install it cleanly:

sudo apt-get update
sudo apt-get install mysql-server mysql-server-5.7 mysql-client-5.7 mysql-client

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.