我在 Ubuntu 上安装 KDE plasma,但是电源被切断了。当我尝试重新安装时,出现错误。
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).
我尝试使用sudo apt-get --purge remove kubuntu-desktop
,但失败了。使用sudo apt-get -f install
无效。
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 60 not upgraded.
704 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 ... 293342 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)
我也使用过sudo dpkg --remove --force-remove-reinstreq kubuntu-desktop
,它成功完成,但没有效果。我无法安装 synaptic,也无法升级软件包。我也无法删除google-im.service
答案1
只需运行:
sudo dpkg -i --force-all /var/cache/apt/archives/kde-config-telepathy-accounts_4%3a15.12.3-0ubuntu1_i386.deb
这将重新安装软件包,并强制覆盖文件。这个问题通常发生在将文件从一个软件包移动到另一个软件包时,由于存储库不是完全最新的,或者像你的情况一样,安装中断,新文件无法解压,因为它似乎与另一个软件包冲突。
上述命令的作用是使 dpkg 忽略所有错误(通过使用标志--force-all
)。您也可以使用--force-overwrite
。