在安装了mysql的mariadb后,我遇到了问题,mysql无法工作,所以我试图卸载mysql,但包坏了。在尝试解决这个问题后,我愚蠢地删除了所有的mysql文件。目前:
我尝试过dpkg -l | grep mysql,但一无所获
所以我试了下dpkg -l | grep mysql,得到了
mysql-client-8.0 install
mysql-client-core-8.0 install
mysql-common install
mysql-server-8.0 install
mysql-server-core-8.0 install
php7.4-mysql install在尝试删除mysql-server-8.0之后:
sudo dpkg --remove --force-remove-reinstreq mysql-server-8.0我得到了:
(Reading database ... 219264 files and directories currently installed.)
Removing mysql-server-8.0 (8.0.22-0ubuntu0.20.10.2) ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: error processing package mysql-server-8.0 (--remove):
installed mysql-server-8.0 package pre-removal script subprocess
returned error exit status 1
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 not found.
invoke-rc.d: initscript mysql, action "start" failed.
Unit mysql.service could not be found.
dpkg: error while cleaning up:
installed mysql-server-8.0 package post-installation script subprocess
returned error exit status 1
Errors were encountered while processing:
mysql-server-8.0有没有办法解决这个问题,完全清除mysql,然后安装mariadb??如果没有,我想解决这个问题的唯一方法就是重新安装操作系统。谢谢!!
发布于 2021-02-19 10:25:55
在做了一些检查之后,我发现了另一个post on ServerFault,它详细说明了安装脚本的问题。我也遇到了同样的问题,在确保所有MySQL文件都被删除后,我转到/var/lib/dpkg/info并运行sudo rm -rf ./mysql-*。这样做之后,您就可以运行sudo dpkg --remove --force-remove-reinstreq mysql-server-8.0了。
这是一个核心选项,我不建议您这样做,直到您100%确定没有来自MySQL安装的更多文件。
https://stackoverflow.com/questions/65949014
复制相似问题