16

Yesterday it got stuck with an update for MySql. The mysql-apt-config didn't finish for ours so I had to shut down the machine in the end.

Today it suggested the same update again, but told me that I had to use dpkg --configure -a to fix the package first. When I do this it again hangs:

# sudo dpkg --configure -a
mysql-apt-config (0.3.3-1debian7) wird eingerichtet ..

Last line in german means roughly "[...] is getting prepared ...".

I've also tried to remove the mysql package with apt-get purge mysql - but this leads to the same result. It again hangs at the same step.

What can I do to fix this?

Michael Härtl
  • 490
  • 1
  • 4
  • 17
  • 1
    Same problem here. Seems to be something wrong in the package. Currently trying to find out exactly whats happening or if I can uninstall it since it blocks other updates. xP – Gladen Mar 05 '15 at 10:35
  • 2
    I wouldn't consider this off-topic. It affects a lot of Ubuntu users. – Bas Peeters Mar 06 '15 at 08:42

1 Answers1

16

I had got the same problem a few hours ago. First I've killed the stuck process (kill -9 PID, or complete restart) then I completely uninstalled mysql.

sudo apt-get remove --purge mysql-server mysql-client mysql-common

or

sudo apt-get remove --purge mysql*

This will uninstall all mysql related packages, what is in most cases a bit overkill...

Be careful to make a copy of your databases before do this or simply don't delete the database when the uninstall process asks about it. Then restart again (or kill the process of mysql-apt-config) and remove the mysql-apt-config package.

sudo apt-get remove --purge mysql-apt-config
sudo apt-get autoremove

After these steps I installed again everything solved the problem.

sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql

I'm not sure but probably it's enough to reinstall only mysql-apt-config. Good luck guys!

paraleo
  • 176
  • 1
  • 3
  • This works. I first missed the second part of your answer (removing mysql-apt-config), but this then seems to have done the trick. Thanks. – Michael Härtl Mar 06 '15 at 09:12
  • 1
    Simply purging mysql-apt-config and installing it from scratch worked for me here too. – Gladen Mar 07 '15 at 14:55
  • 2
    `sudo apt-get remove --purge mysql-apt-config` or on any other command ubuntu says me to run `sudo dpkg --configure -a`, but running `dpkg` the mysql-apt-config just stucks on the question "Which server version do you wish to receive?", does not matter which option I choose it still continue asking to choose one option of three: mysql-5.6, mysql-5.7-dmr, none. How can I remove the package at this point? – Igor Mar 07 '15 at 20:15
  • 3
    finally found the solution here, http://stackoverflow.com/questions/27154067/could-not-select-ok-in-mysql-apt-config-ubuntu-14-04 – Igor Mar 07 '15 at 20:19
  • 1
    Restart didn't work for me. But `pkill mysql` let the update process to continue configuring other softwares and then I could purge mysql. – Mohammad Etemaddar Dec 20 '19 at 19:00