I unfortunately messed up my mysql installation, when I thought I could just install mariadb next to it. Now I am not even able to remove and re-install it. As I have a lot of other things set up in this system I would like to avoid to freshly install Ubuntu.
So far I tried everything that was proposed in this answer and also what is proposed here. However I end up with the following error message:
What can I do to rescue the system. I don't care about the data in the sql database as this is gone for good now I believe.
When trying to sudo dpkg --purge --force-all mysql-server and sudo apt install mysql-server I get the error message:
update-alternatives: error: alternative path /etc/mysql/mysql.cnf doesn't exist
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status 2
dpkg: dpendency 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 (--configured):
dependency problems - leaving unconfigured
No apport repport written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
mysql-server-5.8
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

/etc/mysql/my.cnf. That comes as part ofmysql-commonpackage. Consider doingapt-get remove --purge mysql-serverfirst then try installing thatmysql-commonpackage , and finally reinstalling server and client package – Sergiy Kolodyazhnyy Aug 23 '18 at 12:16sudo apt-get remove --purgeit saySetting up mysql-server-5.7and then tells mealternative path /etc/mysql/mysql.cnfdoes not exist. It also saysmy-sql-server-5.7 is not configured yetand ends with/usr/bin/dpkg returned an error code (1)– Axel Aug 23 '18 at 12:31sudo dpkg-reconfigure mysql-serverormysql-server-5.7return anything meaningful ? – Sergiy Kolodyazhnyy Aug 23 '18 at 12:35sudo dpkg --purge --force-all mysql-server– Sergiy Kolodyazhnyy Aug 23 '18 at 12:38sudo dpkg-reconfigure mysql-serverreturnsmysql-server is broken or not fully installedandsudo dpkg-reconfigure mysql-server-5.7returnsmysql-server-5.7 is broken or not fully installed:/ – Axel Aug 23 '18 at 12:38sudo dpkg --purge --force-all mysql-servercan I just trying to re-install bysudo apt-get install mysql-server? – Axel Aug 23 '18 at 12:40