如何用 apt-get 解决软件包冲突

如何用 apt-get 解决软件包冲突

我遇到了一些软件包冲突,导致我无法安装其他所需软件:我想安装tftp但出现以下情况:

ron@jpax-build07:~/tmp$ sudo apt install tftp
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:
 kde-telepathy-minimal : Depends: kde-config-telepathy-accounts (>= 15.04.0) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
ron@jpax-build07:~/tmp$

好的,我尝试了一下:

ron@jpax-build07:~/tmp$ sudo apt -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  libpthread-stubs0-dev:i386 libx11-dev:i386 libxau-dev:i386 libxcb1-dev:i386
  libxdmcp-dev:i386 libxext-dev:i386 libxfixes-dev:i386 libxtst6:i386
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  kde-config-telepathy-accounts
The following NEW packages will be installed:
  kde-config-telepathy-accounts
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
444 not fully installed or removed.
Need to get 0 B/137 kB of archives.
After this operation, 825 kB of additional disk space will be used.
Do you want to continue? [Y/n]
(Reading database ... 303598 files and directories currently installed.)
Preparing to unpack .../kde-config-telepathy-accounts_4%3a15.12.3-0ubuntu1_amd64.deb ...
Unpacking kde-config-telepathy-accounts (4:15.12.3-0ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/kde-config-telepathy-accounts_4%3a15.12.3-0ubuntu1_amd64.deb (--unpack):
 trying to overwrite '/usr/share/accounts/services/google-im.service', which is also in package account-plugin-google 0.12+16.04.20160126-0ubuntu1
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Errors were encountered while processing:
 /var/cache/apt/archives/kde-config-telepathy-accounts_4%3a15.12.3-0ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
ron@jpax-build07:~/tmp$

我怎样才能摆脱这种困境?

更新1

当我这样做时$ sudo apt remove kde-config-telepathy-accounts,我得到了Package 'kde-config-telepathy-accounts' is not installed, so not removedwhere$ sudo apt remove account-plugin-google给出了未满足的依赖关系, kde-telepathy-minimal其中依赖kde-config-telepathy-accounts- 这没有意义!

答案1

仔细阅读错误消息,寻找实际的 dpkg 错误。

这是您的,它可能与发现此线程的大多数其他人不同。

dpkg:处理存档 /var/cache/apt/archives/kde-config-telepathy-accounts_4%3a15.12.3-0ubuntu1_amd64.deb (--unpack) 时出错:试图覆盖“/usr/share/accounts/services/google-im.service”,该文件也在软件包 account-plugin-google 0.12+16.04.20160126-0ubuntu1 中

让我们把它拆开,并更清楚地重述一下:

dpkg: 处理 PACKAGE_A (--unpack) 时出错:尝试覆盖 FILE_NAME,而该文件也在 PACKAGE_B 中

现在您能明白错误信息想要表达什么吗?

系统中的大多数文件一次只能由一个软件包提供。当两个软件包尝试提供同一个文件时,它们冲突。您不能同时安装两者。

您可以通过决定要保留哪个包并卸载另一个包来解决问题。

相关内容