Package upgrade hangs forever on mysql-apt-configure [closed]

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?


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!