APT 与 dpkg - 删除存在依赖问题的软件包(心灵感应)

APT 与 dpkg - 删除存在依赖问题的软件包(心灵感应)

我想尝试一个应用程序(Kamoso),但它的安装失败,现在系统托盘图标告诉我:

发生错误...运行包管理器或 apt-get 查看错误原因。错误:BrokenCount>0

$ sudo 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:
  kde-config-telepathy-accounts
The following NEW packages will be installed:
  kde-config-telepathy-accounts
0 upgraded, 1 newly installed, 0 to remove and 10 not upgraded.
2 not fully installed or removed.
Need to get 0 B/148 kB of archives.
After this operation, 808 kB of additional disk space will be used.


  Do you want to continue? [Y/n] y
    (Reading database ... 1330003 files and directories currently installed.)
    Preparing to unpack .../kde-config-telepathy-accounts_4%3a15.12.3-0ubuntu1_i386.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_i386.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-0ubuntu7) ...
    Errors were encountered while processing:
     /var/cache/apt/archives/kde-config-telepathy-accounts_4%3a15.12.3-0ubuntu1_i386.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)

Ubuntu 软件中心修复失败:

    installArchives() failed: (Reading database ... 
(Reading database ... 100%
(Reading database ... 1330003 files and directories currently installed.)
Preparing to unpack .../kde-config-telepathy-accounts_4%3a15.12.3-0ubuntu1_i386.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_i386.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-0ubuntu7) ...
Errors were encountered while processing:
 /var/cache/apt/archives/kde-config-telepathy-accounts_4%3a15.12.3-0ubuntu1_i386.deb
dpkg: dependency problems prevent configuration of kde-telepathy-minimal:
 kde-telepathy-minimal depends on kde-config-telepathy-accounts (>= 15.04.0); however:
  Package kde-config-telepathy-accounts is not installed.

dpkg: error processing package kde-telepathy-minimal (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of kde-telepathy:
 kde-telepathy depends on kde-telepathy-minimal (= 15.04.20ubuntu1); however:
  Package kde-telepathy-minimal is not configured yet.

dpkg: error processing package kde-telepathy (--configure):
 dependency problems - leaving unconfigured

我尝试删除或清除 kde-telepathy-minimal 或 kde-telepathy:

$ sudo apt-get purge kde-telepathy
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).

您能否帮助我删除其中一个软件包,作为清理这个损坏的安装并让软件包管理器恢复工作的解决方案?

答案1

感谢@user535733有用的评论:“使用 dpkg 卸载有问题的(冲突的)软件包,然后使用 apt 清理依赖项”

以下是我删除冲突软件包的方法:

$ sudo dpkg --remove kde-telepathy
(Reading database ... 1330002 files and directories currently installed.)
Removing kde-telepathy (15.04.20ubuntu1) ...

$ sudo dpkg --remove kde-telepathy-minimal
(Reading database ... 1329999 files and directories currently installed.)
Removing kde-telepathy-minimal (15.04.20ubuntu1) ...

之后我清理了

sudo apt autoremove

相关内容