我正在尝试使用此命令从aws实例Ubuntu 20.04.1 LTS
中完全删除mysql
sudo apt-get remove mysql*
但它抛出了各种各样的错误:
// important ones:
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
最后:
Errors were encountered while processing:
mysql-server-8.0
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
当我打字时:
whereis mysql
我看到了:
mysql: /usr/bin/mysql /usr/lib/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz
我很确定我在拆除它的过程中把某个地方搞砸了,我不知道如何让它回到正轨。
有没有一种方法可以在不使用dpkg的情况下清除所有内容?
谢谢。
如图所示:
sudo systemctl disable mysql
sudo apt remove mysql*
sudo apt purge mysql*
sudo apt autoremove
我还删除了已知的mysql文件和目录:
sudo rm -r /etc/mysql /var/lib/mysql /var/log/mysql
以及运行时显示的文件和目录
whereis mysql