Reinstalling ubuntu packages

I lost my mariadb root password and the recovery process does not work after many tries. Since I was not actually using any databases on that machine. I decided to simply reinstall MySQL server. But just running

sudo apt purge mysql*

didn’t clean up everything. I still got configuration errors when I try to reinstall the new mysql server and client using

sudo apt install mysql-server mysql-client

It turns out that the installation was “stuck” by the php7.2-mysql. I eventually found this out by

sudo dpkg -l |grep mysql

as mentioned here. So just running

sudo apt purge php7.2-mysql

fixed the problem. It seems that dpkg -l is a great way to resolve other ubuntu package problems as well.

Leave a Reply

Your email address will not be published. Required fields are marked *