首页 > 解决方案 > Ubuntu 20 无法卸载 mysql 服务器

问题描述

我试图使用 apt-get purge mysql-server 卸载 mysql,但卸载不成功,现在它阻止了 mariadb 的安装。

petter@server:~$ sudo dpkg -P --force-all mysql-server-8.0
(Reading database ... 71256 files and directories currently installed.)
Removing mysql-server-8.0 (8.0.22-0ubuntu0.20.04.3) ...
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 (--purge):
    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

标签: mysqlubuntudpkgsystemctl

解决方案


可能有些丢失的文件,请先尝试重新安装它--reinstall,然后再修剪它


推荐阅读