Ubuntu 19.04 apt 破坏依赖项:mono

Ubuntu 19.04 apt 破坏依赖项:mono

我在 ubuntu 19.04 上使用 apt 时遇到问题。每次我尝试安装或升级 apt 包时都会出现以下错误:

You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 mono-complete : Depends: mono-roslyn (= 6.4.0.198-0xamarin3+ubuntu1804b1) but it is not going to be installed
 mono-devel : Depends: mono-roslyn (= 6.4.0.198-0xamarin3+ubuntu1804b1) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

运行时sudo apt -f install我遇到以下错误:

dpkg: error processing archive /var/cache/apt/archives/mono-roslyn_6.4.0.198-0xamarin3+ubuntu1804b1_all.deb (--unpack):
 trying to overwrite '/usr/bin/csc', which is also in package chicken-bin 4.13.0-1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/mono-roslyn_6.4.0.198-0xamarin3+ubuntu1804b1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

简而言之:mono-roslyn正在尝试覆盖当前由(CHICKEN 方案编译器)csc使用的二进制文件。chicken-bin

我尝试将csc二进制文件从移至/usr/bin/csc/usr/bin/csc-chicken检查是否能解决问题。但问题并未解决,我仍然遇到相同的错误。

我之前遇到过与 apt 和 mono 有关的问题,我用 修复了这些问题sudo apt autoremove,但却出现了与这里显示的第一个相同的错误。

我需要修复此问题才能升级或安装新软件包。你可以想象这是一个相当紧迫的问题。

答案1

几天后,我找到了解决方案。我决定直接删除,chicken-bin这样 mono 就可以正确安装(虽然不是最理想的,但这是我的最佳选择)。正如我在问题中所说,apt remove这行不通,但我发现我可以使用 删除该包dpkg

以下命令解决了我的问题:

$ sudo dpkg --remove --force-remove-reinstreq chicken-bin
$ sudo apt -f install

希望其他人会发现这很有用。

相关内容