我尝试运行 apt-get update 时遇到问题,出现如下错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
libmysqlclient20 : Depends: mysql-common (= 5.7.13-1ubuntu16.04)
E: Unmet dependencies. Try using -f.
之后我按照建议运行 apt-get -f install,但出现以下其他错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
mysql-common
The following packages will be upgraded:
mysql-common
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
90 not fully installed or removed.
Need to get 0 B/264 kB of archives.
After this operation, 2.680 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 235067 files and directories currently installed.)
Preparing to unpack .../mysql-common_5.7.13-1ubuntu16.04_amd64.deb ...
Unpacking mysql-common (5.7.13-1ubuntu16.04) over (5.7.12-0ubuntu1.1) ...
dpkg: error processing archive /var/cache/apt/archives/mysql-common_5.7.13-1ubuntu16.04_amd64.deb (--unpack):
trying to overwrite '/usr/share/mysql/italian/errmsg.sys', which is also in package mariadb-server-core-10.0 10.0.25-0ubuntu0.16.04.1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/mysql-common_5.7.13-1ubuntu16.04_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我是否应该完全删除 mysql 来修复此问题?请提供意见。
答案1
@mbahlol 我可以通过以下命令修复该问题:
sudo cp /etc/mysql/my.cnf /etc/mysql/my.cnf.fallback
当你第一次做的时候
sudo apt upgrade
mysql-common 解释说它找不到以前的 mysql 配置文件,所以我创建了它,现在看来一切正常,希望你的情况也一样