无法卸载 MariaDB

无法卸载 MariaDB

我尝试重新安装 MariaDB,我使用了:

sudo apt-get purge mysql* mariadb*

但是,上述尝试失败后,唯一剩余需要卸载的软件包是mariadb-server-10.0

当我尝试使用以下命令清除它时:

sudo apt-get purge mariadb-server-10.0

我得到了这个输出:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
libdbi-perl libterm-readkey-perl
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  mariadb-server-10.0*
0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded.
1 not fully installed or removed.
After this operation, 74.5 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 50%
(Reading database ... 460851 files and directories currently installed.)
Removing mariadb-server-10.0 (10.0.23-0ubuntu0.15.04.1) ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: error processing package mariadb-server-10.0 (--purge):
subprocess installed pre-removal script returned error exit status 5
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
Failed to start mysql.service: Unit mysql.service failed to load: No such file or directory.
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 6
Errors were encountered while processing:
mariadb-server-10.0
E: Sub-process /usr/bin/dpkg returned an error code (1)

我该如何尝试修复此问题?谢谢

答案1

MariaDB 是 MySQL 的一个开源版本(没有母公司 Oracle 的任何麻烦)。您需要从 MariaDB 的安装日志中找出 MySQL 的安装位置(它可能位于 /etc/init.d 下),然后停止它

sudo /etc/init.d/mysql stop

完成后,执行您要执行的相同操作。

相关内容