Mono 的依赖性问题阻止(系统)更新和安装/删除软件包

Mono 的依赖性问题阻止(系统)更新和安装/删除软件包

我长期以来一直在与 Mono(版本:6.12.0.122)相关的依赖问题苦苦挣扎,这使得我无法执行系统升级(Pop!_OS,基于 Ubuntu)和安装/删除软件包。问题是我什至无法删除或重新安装 Mono 软件包。无论我做什么(并且我经历了很多线程和“解决方案”),我都不能......

  • 执行从 Pop!_OS 21.10 到 22.04 的系统升级
  • 更新 Pop!_Shop
  • (卸载)使用 apt-get 安装任何软件包(包括 Mono!)

正在尝试更新 Pop!购买或执行较小的系统升级(升级包)会导致弹出窗口显示此内容(翻译自德语):

Error while installing package: Attempt to overwrite »/usr/lib/mono/4.5/mscorlib.dll«, which is also included in package libmono-corlib4.5-cil 6.12.0.122-0xamarin1+ubuntu2004b1

sudo apt --fix-broken install例如在最后打印出来(翻译自德语;原始错误消息:https://paste.myst.rs/joogjhfc):

Unpacking libmono-corlib4.5-dll (6.8.0.105+dfsg-3.2) ...
dpkg: Error processing archive /var/cache/apt/archives/libmono-corlib4
.5-dll_6.8.0.105+dfsg-3.2_all.deb (--unpack):
 Attempt to overwrite »/usr/lib/mono/4.5/mscorlib.dll« , which is also included in package libmono-corlib4.5-cil 6.12.0.122-0xamarin1+ubuntu2004b1
dpkg-deb: Error: "insert" subprocess was killed by signal (broken pipe)
Errors occurred while editing:
 /var/cache/apt/archives/libmono-corlib4.5-dll_6.8.0.105+dfsg-3.2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

sudo apt remove mono-runtime不成功,因为许多子包依赖于它并且操作失败(翻译自德语;原始错误消息:https://paste.myst.rs/msqb6tm3):

Try "apt --fix-broken install" to fix this.
The following packages have unfulfilled dependencies:
ca-certificates-mono : Depends on: mono-runtime (>= 3.0~) but should not be installed.
 libmono-corlib4.5-cil : depends on: mono-runtime (>= 6.12.0.122) but should not be installed
                         Depends on: mono-runtime (< 6.12.0.123) but should not be installed
                         Recommends: libmono-i18n-west4.0-cil but should not be installed
 libmono-http4.0-cil : Depends on: libmono-system-web4.0-cil (>= 2.10.3) but should not be installed
 libmono-i18n-mideast4.0-cil : Depends on: libmono-i18n4.0-cil (>= 4.0.0~alpha1) but should not be installed
 libmono-i18n-other4.0-cil : Depends on: libmono-i18n4.0-cil (>= 4.0.0~alpha1) but should not be installed
 libmono-microsoft-web-infrastructure1.0-cil : Depends on: libmono-system-web4.0-cil (>= 2.10.3) but should not be installed
 libmono-posix4.0-cil : Depends on: mono-runtime (>= 2.10.1) but should not be installed
 libmono-security4.0-cil : depends on: libmono-corlib4.5-dll (>= 5.18.0.240) but should not be installed
                           Recommends: ca-certificates-mono (= 6.8.0.105+dfsg-3.2) but 6.12.0.122-0xamarin1+ubuntu2004b1 should be installed
 libmono-system-configuration4.0-cil : Depends on: libmono-corlib4.5-dll (>= 5.18.0.240) but should not be installed
 libmono-system-core4.0-cil : Depends on: libmono-corlib4.5-dll (>= 5.18.0.240) but should not be installed
 libmono-system-design4.0-cil : Depends on: libmono-system-web4.0-cil (>= 2.10.3), but should not be installed.
                                depends on: libmono-system-windows-forms4.0-cil (>= 1.0) but should not be installed
 libmono-system-drawing-design4.0-cil : Depends on: libmono-system-windows-forms4.0-cil (>= 1.0) but should not be installed
 libmono-system-messaging4.0-cil : Depends on: libmono-system-windows-forms4.0-cil (>= 1.0) but should not be installed
 libmono-system-numerics4.0-cil : Depends on: libmono-corlib4.5-dll (>= 5.18.0.240) but should not be installed
 libmono-system-reactive-windows-forms2.2-cil : Depends on: libmono-system-windows-forms4.0-cil (>= 1.0) but should not be installed
 libmono-system-runtime4.0-cil : Depends on: libmono-system-web4.0-cil (>= 2.10.3) but should not be installed
 libmono-system-security4.0-cil : Depends on: libmono-corlib4.5-dll (>= 5.18.0.240) but should not be installed
 libmono-system-servicemodel4.0a-cil : Depends on: libmono-system-web4.0-cil (>= 2.10.3) but should not be installed
 libmono-system-serviceprocess4.0-cil : Depends on: libmono-system-windows-forms4.0-cil (>= 1.0) but should not be installed
 libmono-system-web-abstractions4.0-cil : Depends on: libmono-system-web4.0-cil (>= 2.10.3) but should not be installed
 libmono-system-web-dynamicdata4.0-cil : Depends on: libmono-system-web4.0-cil (>= 2.10.3) but should not be installed
 libmono-system-web-extensions4.0-cil : Depends on: libmono-system-web4.0-cil (>= 2.10.3) but should not be installed
 libmono-system-web-http-webhost4.0-cil : Depends on: libmono-system-web4.0-cil (>= 2.10.3) but should not be installed
 libmono-system-web-routing4.0-cil : Depends on: libmono-system-web4.0-cil (>= 2.10.3) but should not be installed
 libmono-system-web-services4.0-cil : Depends on: libmono-system-web4.0-cil (>= 2.10.3) but should not be installed
 libmono-system-xml4.0-cil : Depends on: libmono-corlib4.5-dll (>= 5.18.0.240) but should not be installed
 libmono-system4.0-cil : Depends on: libmono-corlib4.5-dll (>= 5.18.0.240) but should not be installed.
                         Recommends: ca-certificates-mono (= 6.8.0.105+dfsg-3.2) but 6.12.0.122-0xamarin1+ubuntu2004b1 should be installed
 libmono-windowsbase4.0-cil : depends on: mono-runtime (>= 2.10.1) but should not be installed
 mono-csharp-shell : Depends on: mono-runtime (>= 3.0~) but should not be installed
 mono-mcs : Depends on: mono-runtime (>= 3.0~) but should not be installed
 mono-xbuild : depends on: mono-runtime (>= 3.0~) but should not be installed
E: Unfulfilled dependencies. Try "apt --fix-broken install" without specifying a package (or specify a solution).

执行后sudo dpkg --configure -a,还有一长串依赖项错误消息,最后,它表示尝试编辑以下包时出现错误:

libmono-security4.0-cil
libmono-system4.0-cil
libmono-system-numerics4.0-cil
libmono-system-core4.0-cil
libmono-system-security4.0-cil
libmono-system-xml4.0-cil
libmono-system-configuration4.0-cil

还有其他略有不同的输出,但它们本质上都是相同的,以及许多其他绝望的尝试、命令和据称解决这个问题的方法,但都以失败告终。

我该如何应对这种情况?我的目标是能够将我的系统更新到 22.04,按照我的意愿安装和删除软件包。

答案1

dpkg --list | grep mono | awk '{ print $2 }' | xargs sudo dpkg --force-all -P 
apt --fix-broken install

这对我有用

相关内容