https://askubuntu.com/questions/176121/dpkg-error-trying-to-overwrite-file-which-is-also-in
https://askubuntu.com/questions/1067430/apt-fix-broken-install-does-not-work-package-manager-broken-after-installing
https://askubuntu.com/questions/899497/cannot-fix-broken-packages-apt-get-f-install-doesnt-work
我无法安装任何东西或升级我的系统。我尝试使用上面链接的各种其他答案中的解决方案,但它们不起作用。我尝试清除该软件包libkf5auth-dev
,但它是libkf5configwidgets-dev
我libkf5configwidgets-dev
系统中许多其他软件包的依赖项。我正在运行基于 18.04 LTS 的 KDE Neon,但在此之前我从未遇到过任何 aptitude 问题。
当我运行时sudo apt upgrade
,它给我这个输出:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libkf5auth-dev : Depends: libkf5auth5 (= 5.52.0+p18.04+git20181118.0151-0) but 5.52.0+p18.04+git20181130.1300-0 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
当我运行时sudo apt --fix-broken install
,它给我这个输出: https://pastebin.com/5DSJKV0S
运行apt-cache policy libkf5auth5 libkf5auth-dev libkf5configwidgets-dev
给我这个输出:https://pastebin.com/QuX1gYa8
答案1
第一个粘贴箱说(在底部):
[...] trying to overwrite '/usr/lib/x86_64-linux-gnu/cmake/KF5Auth/KF5AuthToolsTargets-debian.cmake', which is also in package libkf5auth-bin-dev:amd64 5.52.0+p18.04+git20181118.0151-0"
这似乎是您的直接问题。
更广泛的问题是你正在使用一天前的 git 包,除非你真的知道你在做什么,否则这是一个坏主意。
sudo apt purge libkf5auth-bin-dev:amd64
或者如果失败则使用 dpkg:
sudo dpkg --force-all --remove libkf5auth-bin-dev
然后你应该能够进行升级。警告:当您“强制”某个软件包时,dpkg 会删除该软件包,即使该软件包会耗尽您的系统并使其无法使用;小心!
sudo apt install libkf5auth-dev
但请注意,当您安装最近开发的软件包时,它们可能存在错误,包括软件包本身的错误,例如apt
根本无法一致解决的无法解决的依赖关系问题。可能无法使用 apt 安装这些软件包。