0

I have been struggling for a long time with a dependency issue related to Mono (version: 6.12.0.122) that makes it impossible for me to perform a system upgrade (Pop!_OS, which is based on Ubuntu) and install/remove packages. The problem is that I can't even remove or reinstall the Mono package. No matter what I do (and I went through a lot of threads and "solutions"), I can't...

  • perform a system upgrade from Pop!_OS 21.10 to 22.04
  • update the Pop!_Shop
  • (un)install any package with apt-get (including Mono!)

Trying to update the Pop! Shop or performing minor system upgrades (upgrading packages) results in a pop-up showing this (translated from German):

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 for example prints this out at the end (translated from German; original error message: 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 is unsuccessful, as many sub-packages depend on it and the operation fails with (translated from German; original error message: 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).

After performing sudo dpkg --configure -a, there is another long list of dependency error messages and at the end, it says there were errors while trying to edit the following packages:

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

There are also other slightly different outputs, but they all essentially say the same, as well as many other desperate attempts, commands and ways to supposedly solve this, all ended unsuccessful.

How do I tackle this situation? My goal is to be able to update my system to 22.04, install and remove packages as I wish.

1 Answer 1

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

This worked for me

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .