我正在尝试使用此命令从 aws 实例中完全删除 mysqlUbuntu 20.04.1 LTS
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
所以它并没有被彻底消除。
谢谢。
答案1
使用命令:sudo dpkg -l | grep mysql
找到已安装的 mysql 包,然后删除它们sudo apt --purge autoremove package_name
。然后您可以尝试重新安装它