我正在尝试安装 mysql-server 但出现此错误:
$ sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-server is already the newest version (5.7.25-0ubuntu0.18.04.2).
The following package was automatically installed and is no longer required:
python-gi
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up mysql-server-5.7 (5.7.25-0ubuntu0.18.04.2) ...
Renaming removed key_buffer and myisam-recover options (if present)
Checking if update is needed.
This installation of MySQL is already upgraded to 5.7.25, use --force if you still need to run mysql_upgrade
dpkg: error processing package mysql-server-5.7 (--configure):
installed mysql-server-5.7 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
据我了解,我需要对 mysql-server-5.7 的依赖项进行一些配置。是吗?
可能是这个问题的重复: dpkg: error processing package mysql-server (--configure)
看起来安装在较早的尝试中被中断。您正面临依赖关系中断的问题。由于您已经尝试运行
--force
但无济于事,请先清除现有的 MySqL 安装然后清理剩菜。更新系统。进行一般升级。
现在重新安装