依赖问题

依赖问题

在运行apt upgrade或 时apt dist-upgrade,终端显示错误:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libpython3-stdlib mysql-common python3
Suggested packages:
  python3-doc python3-tk python3-venv
The following packages will be upgraded:
  libpython3-stdlib mysql-common python3
3 upgraded, 0 newly installed, 0 to remove and 267 not upgraded.
68 not fully installed or removed.
Need to get 0 B/740 kB of archives.
After this operation, 2,303 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Reading changelogs... Done
(Reading database ... 331398 files and directories currently installed.)
Preparing to unpack .../mysql-common_5.6.29-1debian7_amd64.deb ...
Unpacking mysql-common (5.6.29-1debian7) over (5.6.28-1) ...
dpkg: error processing archive /var/cache/apt/archives/mysqlcommon_5.6.29-1debian7_amd64.deb (--unpack):
 trying to overwrite '/usr/share/mysql/charsets/cp1251.xml', which is also in package mysql-server-core-5.6 5.6.28-1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/mysql-common_5.6.29-1debian7_amd64.deb

我尝试运行apt install -fapt purge mysql-common,但这没有用。该怎么办?

运行时apt update

Ign:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://dl.google.com/linux/chrome/deb stable Release
Hit:4 http://repo.mysql.com/apt/debian wheezy InRelease      
Get:5 http://archive-3.kali.org/kali kali-rolling InRelease [24.6 kB]
Get:6 http://archive-3.kali.org/kali kali-rolling/main amd64 Packages [13.6 MB]
Get:7 http://archive-3.kali.org/kali kali-rolling/non-free amd64 Packages [143 kB]
Fetched 13.8 MB in 6min 16s (36.5 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
287 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: http://dl.google.com/linux/chrome/deb/dists/stable/Release.gpg: Signature by key 4CCA1EAF950CEE4AB83976DCA040830F7FAC5991 uses weak digest algorithm (SHA1)
W: http://repo.mysql.com/apt/debian/dists/wheezy/InRelease: Signature by key A4A9406876FCBD3C456770C88C718D3B5072E1F5 uses weak digest algorithm (SHA1)

运行时apt-cache policy mysql-common mysql-server-core-5.6

mysql-common:
  Installed: 5.6.28-1
  Candidate: 5.6.29-1debian7
  Version table:
     5.6.29-1debian7 500
        500 http://repo.mysql.com/apt/debian wheezy/mysql-5.6 amd64 Packages
 *** 5.6.28-1 500
        500 http://http.kali.org/kali kali-rolling/main amd64 Packages
        100 /var/lib/dpkg/status
mysql-server-core-5.6:
  Installed: 5.6.28-1
  Candidate: 5.6.28-1
  Version table:
 *** 5.6.28-1 500
        500 http://http.kali.org/kali kali-rolling/main amd64 Packages
        100 /var/lib/dpkg/status

答案1

你的问题很清楚。您正在混合使用两个不同且不兼容的 MySQL 5.6 版本。

其中之一是 Kali Linux 版本。您的网址显示 kali-rolling,因此这可能不是一个版本。另一个似乎是 MySQL 的上游版本(来自 mysql.com),用于 Debian Wheezy (6.x)。

请注意,作为 Debian 的衍生产品,Kali 包含与 Debian 相同的软件包,但版本可能有所不同,并且很容易不兼容。您的 Kali 版本似乎并不打算与 Debian Wheezy 兼容。因此,尝试同时安装这两个不同的版本会导致问题也就不足为奇了。

我建议从您的 中删除 mysql.com url sources.list,并坚持使用您的发行版提供的软件包。您还可以查阅您的发行版文档,以确定哪些版本的 Debian(如果有)与您正在运行的 Kali 版本兼容。

最后,请注意 HTML 标签不一定用于格式化 Markdown。要格式化代码或类似代码的输出,只需选择文本,然后按代码按钮(两个大括号)。或者您可以手动将所有文本向右移动 4 个空格。

相关内容