无法在ubuntu16.0.4中安装mysql-server

sudo apt-get install mysql-server失败了阻塞此时

 var/lib/dpkg/info/mysql-server-5.7.postinst: line 143: /usr/share/mysql-common/configure-symlinks: No such file or directory 

我发现这个bug的解决方案是注释/var/lib/dpkg/info/mysql-server-5.7.postinst文件中的第143行。

但我的问题是我找不到/var/lib/dpkg/info/mysql-server-5.7.postinst文件..不要说评论一行。

那么如何摆脱陷入困境的局面呢


ps:我已经安装了mariadb并通过我google搜索的步骤将其卸载


更新:

我已按照第一个答案给出的步骤进行操作,之前仍然提示错误

令人惊讶的是,这次我可以sudo vim /var/lib/dpkg/info/mysql-server-5.7.postinst file并且我对第143行进行注释,但它报告了另一个错误

 ERROR: Unable to start MySQL server: 2017-11-26T08:51:57.033255Z 0 [Note] mysqld (mysqld 5.7.20-0ubuntu0.16.04.1-log) starting as process 22612 ... 2017-11-26T08:51:57.034651Z 0 [ERROR] You have enabled the binary log, but you haven't provided the mandatory server-id. Please refer to the proper server start-up parameters documentation 2017-11-26T08:51:57.035603Z 0 [ERROR] Aborting 

只需清除所有mysql包并重新安装:

 sudo apt-get remove --purge *mysql* sudo apt-get autoremove sudo apt-get autoclean sudo apt-get install mysql-server mysql_secure_installation 

我通过添加安装脚本正在寻找的空白文件来解决问题,然后为每个人提供rwx权限。 可能不是最好的方式,但它对我有用。

  sudo touch /usr/share/mysql-common/configure-symlinks sudo chmod 777 /usr/share/mysql-common/configure-symlinks sudo apt-get update sudo apt-get upgrade