我正在尝试在 Ubuntu 20.04 中安装 MySQL 8.0sudo apt install mysql-server
,但是重新安装和使用后仍然出现此错误sudo dpkg --configure -a
:
Setting up mysql-server-8.0 (8.0.25-0ubuntu0.20.04.1) ...
/var/lib/dpkg/info/mysql-server-8.0.postinst: line 191: /usr/share/mysql-common/
configure-symlinks: No such file or directory
dpkg: error processing package mysql-server-8.0 (--configure):
installed mysql-server-8.0 package post-installation script subprocess returned
error exit status 127
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-8.0; however:
Package mysql-server-8.0 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
我完全卸载 MySQL 并重新安装多次sudo apt remove --purge --autoremove mysql-server
,但错误仍然存在。
我遇到了同样的问题,只是发现很好article来解决它。
事实上,不建议直接从 MySQL 文件夹中删除文件。您可以在此处查看本指南,了解如何删除旧的 MySQL 二进制文件here.
关于您当前的问题。为了完全摆脱 MySQL 安装,您可以运行以下命令:
-
确保 MySQL 没有运行:
sudo systemctl stop mysql
-
然后清除所有 MySQL 包:
sudo apt purge mysql-server mysql-client mysql-common mysql-server-core-* mysql-client-core-*
-
然后删除所有MySQL文件:
sudo rm -rf /etc/mysql /var/lib/mysql /var/log/mysql
-
最后清理掉所有不需要的包:
sudo apt autoremove
sudo apt autoclean
希望这有帮助!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)