I'm trying to completely uninstall mysql to reinstall it later, after uninstalling all mysql-related packages, mysql-common seems to remain in a broken state.
$ sudo dpkg -l | grep mysql pc mysql-common 5.6.28-0ubuntu0.15.10.1 all MySQL database common files, e.g. /etc/mysql/my.cnf
But running apt-get remove
$ sudo apt-get remove mysql-common Reading package lists... Done Building dependency tree Reading state information... Done Package 'mysql-common' is not installed, so not removed 0 upgraded, 0 newly installed, 0 to remove and 36 not upgraded.
Or with --purge
$ sudo apt-get remove --purge mysql-common Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: mysql-common* 0 upgraded, 0 newly installed, 1 to remove and 36 not upgraded. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] y (Reading database ... 199090 files and directories currently installed.) Removing mysql-common (5.6.28-0ubuntu0.15.10.1) ... Purging configuration files for mysql-common (5.6.28-0ubuntu0.15.10.1) ... update-alternatives: error: no alternatives for my.cnf dpkg: error processing package mysql-common (--purge): subprocess installed post-removal script returned error exit status 2 Errors were encountered while processing: mysql-common E: Sub-process /usr/bin/dpkg returned an error code (1)
Additionally, I've removed all mysql related directories and files.
How can I get rid of this lingering broken package?