I probably corrupted my mysql configuration when I tried to install it (again) using the ubuntu package manager (stuck in the middle, because of the required interaction for which there is no screen, (package manager should really give a warning that mysql must be installed via the terminal!)).

Maybe already before, but at least since then, I'm stuck with this error (partly in Dutch):

Fouten gevonden tijdens verwerken van:


E: Sub-process /usr/bin/dpkg returned an error code (1)

I get the error when I try to install, as well as when I try to remove the package or any other mysql component. I found many solutions on the internet that worked for others, but failed in my case. I already did the following (in advised order, which may be different from the list below):

  • sudo apt-get remove --purge mysql-server mysql-client mysql-common
  • sudo apt-get autoremove
  • sudo service mysql stop
  • sudo killall -9 mysql (no process found)
  • sudo killall -9 mysqld (no process found)
  • sudo deluser mysql
  • sudo rm -rf /var/lib/mysql
  • sudo apt-get purge mysql-server-core-5.5 (fails)
  • sudo rm -rf /var/log/mysql
  • sudo rm -rf /etc/mysql
  • sudo apt-get remove mysql-client-5.6 (fails)
  • sudo apt-get install mysql-client-5.6 (fails)

    I could not find a listing of all the files related to mysql, to manually delete the lot.

    Any suggestion what else I might try (except reinstalling Ubuntu entirely)?

  • 2
    • Try apt-get install -f Nov 19, 2015 at 12:33
    • I tried it... but the response is the same as I had so many times already: dpkg: fout bij verwerken van pakket mysql-client-5.6 (--configure): pakket mysql-client-5.6 is niet gereed voor configuratie kan het niet configureren (huidige status 'half-installed') Fouten gevonden tijdens verwerken van: mysql-client-5.6 E: Sub-process /usr/bin/dpkg returned an error code (1) Nov 20, 2015 at 15:32

    2 Answers 2


    I had the same issue on VM with Ubuntu 14.04. The only thing worked for me is similar to what Richard Uijen has suggested:

    sudo apt-get --purge remove mysql*
    sudo apt-get autoremove mysql*
    sudo rm -rf /etc/mysql/
    sudo rm -rf /var/lib/mysql/
    sudo apt-get clean
    sudo apt-get update
    sudo apt-get install --reinstall mysql-client-5.6

    Basically you need to remove all mysql packages (mysql*), clean and install again

    After that I could install php7 mysql client without any issues

    sudo apt-get install libapache2-mod-php7.0 php7.0-mysql

    Francisco's reply made me go over the

    sub-process /usr/bin/dpkg returned an error code (1)

    error message again (googled with this text and 'half-installed'. I then tried (I think: again):

    sudo dpkg --configure -a # (gave same error message) 
    sudo dpkg -r mysql-client-5.6 # (error again)
    sudo apt-get clean
    sudo apt-get install --reinstall mysql-client-5.6

    This time, it installed the package... I then removed it. It worked...

    After that, when reinstalling mysql-server, it complained about a missing directory, which was solved by making the directory. It appears to be working now.

    I'm not sure whether this is a generic solution though...


    You must log in to answer this question.

    Not the answer you're looking for? Browse other questions tagged .