apache2、mysql-common、libmysqlclient20:amd64 和 mysql-client-5.7 的依赖问题

apache2、mysql-common、libmysqlclient20:amd64 和 mysql-client-5.7 的依赖问题

我尝试安装一个软件包,但依赖项出现了某种问题。首先,我尝试使用命令清理所有内容sudo apt-get autoremove,但收到与以下类似的错误消息:apt-get install

自动移除后的输出

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up apache2 (2.4.18-2ubuntu3.5) ...
info: Executing deferred 'a2enconf javascript-common' for package javascript-common
ERROR: Conf javascript-common does not exist!
dpkg: error processing package apache2 (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up mysql-common (5.7.20-0ubuntu0.16.04.1) ...
update-alternatives: error: alternative path /etc/mysql/my.cnf.fallback doesn't exist
dpkg: error processing package mysql-common (--configure):
subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of libmysqlclient20:amd64:
libmysqlclient20:amd64 depends on mysql-common (>= 5.5); however:
Package mysql-common is not configured yet.

dpkg: error processing package libmysqlclient20:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of mysql-client-5.7:
 mysql-client-5.7 depends on mysql-common (>= 5.5); however:
 Package mysql-common is not configured yet.

dpkg: error processing package mysql-client-5.7 (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                      No apport report written because MaxReports is reached already
Errors were encountered while processing:
 apache2
 mysql-common
 libmysqlclient20:amd64
 mysql-client-5.7
E: Sub-process /usr/bin/dpkg returned an error code (1)

有什么解决办法吗?似乎软件包等存在一些问题apache2mysql-common但由于我对命令行不是很熟悉,所以我也不知道。

答案1

首先,如果您的数据库中有一些有价值的数据,请备份它。

备份可以通过

mysqldump -u{username} -p{password} {database_name} > {desired_file_name}.sql

-u注意和username之间没有-p空格password

然后彻底清除 mysql 并重新安装(如果需要)

你可以找到如何清除 mysql这里 或者这里

相关内容