apt-get/dpkg 无法正常工作 - 软件包损坏

apt-get/dpkg 无法正常工作 - 软件包损坏

当我尝试使用时,apt-get install <package>我收到以下输出:

The following packages have unmet dependencies:
 mono-complete : Depends: ca-certificates-mono (= 5.18.0.225-0xamarin1+ubuntu1804b1) but 5.16.0.179-0xamarin1+ubuntu1804b1 is installed
 mono-devel : Depends: ca-certificates-mono (= 5.18.0.225-0xamarin1+ubuntu1804b1) but 5.16.0.179-0xamarin1+ubuntu1804b1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

运行后apt --fix-broken install输出为:

. . .

=================================================================
Got a SIGILL while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

Aborted
E: installing Assembly /usr/share/cli-common/policies.d/libgtk2.0-cil/policy.2.8.gtk-sharp.dll failed
E: Installation of policy.2.8.gtk-sharp with /usr/share/cli-common/runtimes.d/mono failed
* Installing 1 assembly from policy.2.8.pango-sharp into Mono
Stacktrace:

/proc/self/maps:
402bb000-402cb000 rwxp 00000000 00:00 0 
4122b000-4124b000 rwxp 00000000 00:00 0 
559963eb7000-559964300000 r-xp 00000000 08:05 2369112                    /usr/bin/mono-sgen
5599644ff000-559964506000 r--p 00448000 08:05 2369112                    /usr/bin/mono-sgen
559964506000-55996450b000 rw-p 0044f000 08:05 2369112                    /usr/bin/mono-sgen
55996450b000-55996459c000 rw-p 00000000 00:00 0 
55996647f000-5599666d5000 rw-p 00000000 00:00 0                          [heap]
7ff930000000-7ff930021000 rw-p 00000000 00:00 0 
7ff930021000-7ff934000000 ---p 00000000 00:00 0 
7ff935800000-7ff935900000 rw-p 00000000 00:00 0 
7ff9359c0000-7ff9359c1000 ---p 00000000 00:00 0 
7ff9359c1000-7ff9359c2000 rw-p 00000000 00:00 0 
7ff9359c2000-7ff9359ca000 ---p 00000000 00:00 0 
7ff9359ca000-7ff935bc1000 rw-p 00000000 00:00 0 
7ff935bc1000-7ff93617d000 r-xp 00000000 08:05 2498584                    /usr/lib/mono/aot-cache/amd64/mscorlib.dll.so
7ff93617d000-7ff93637c000 ---p 005bc000 08:05 2498584                    /usr/lib/mono/aot-cache/amd64/mscorlib.dll.so
7ff93637c000-7ff93637d000 r--p 005bb000 08:05 2498584                    /usr/lib/mono/aot-cache/amd64/mscorlib.dll.so
7ff93637d000-7ff93637e000 rw-p 005bc000 08:05 2498584                    /usr/lib/mono/aot-cache/amd64/mscorlib.dll.so
7ff93637e000-7ff9363a8000 rw-p 00000000 00:00 0 
7ff9363a8000-7ff9367ff000 r--p 00000000 08:05 2497291                    /usr/lib/mono/4.5/mscorlib.dll
7ff9367ff000-7ff9377ff000 rw-p 00000000 00:00 0 
7ff9377ff000-7ff937800000 ---p 00000000 00:00 0 
7ff937800000-7ff938400000 rw-p 00000000 00:00 0 
7ff938548000-7ff938595000 r--p 00000000 08:05 2494161                    /usr/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll
7ff938595000-7ff938fd8000 r--p 00000000 08:05 2367228                    /usr/lib/locale/locale-archive
Memory around native instruction pointer (0x7ff935ce48cf):
0x7ff935ce48bf  20 48 09 d6 41 0f b6 53 05 48 c1 e2 28 48 09 f2   H..A..S.H..(H..
0x7ff935ce48cf  66 41 0f 38 32 4b 06 66 0f 6f 05 72 75 49 00 66  fA.82K.f.o.ruI.f
0x7ff935ce48df  0f 38 00 c8 66 48 0f 7e c8 66 48 0f 3a 16 ce 01  .8..fH.~.fH.:...
0x7ff935ce48ef  48 09 c6 48 09 d6 41 0f b6 c2 41 0f b6 53 09 48  H..H..A...A..S.H

Native stacktrace:

        /usr/bin/mono(+0x129f8d) [0x559963fe0f8d]
        /usr/bin/mono(+0x12a295) [0x559963fe1295]
        /usr/bin/mono(+0xbfd2f) [0x559963f76d2f]
        /usr/bin/mono(+0x414e8) [0x559963ef84e8]
        /lib/x86_64-linux-gnu/libpthread.so.0(+0x12890) [0x7ff9395f3890]
        /usr/lib/mono/aot-cache/amd64/mscorlib.dll.so(+0x1238cf) [0x7ff935ce48cf]

Waiting for dumping threads to resume



Debug info from gdb:

[New LWP 24251]
[New LWP 24252]
Mono support loaded.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007ff9395f323a in __waitpid (pid=24253, stat_loc=0x7ffea840ff84, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
30      ../sysdeps/unix/sysv/linux/waitpid.c: No such file or directory.
  Id   Target Id         Frame 
* 1    Thread 0x7ff93a194780 (LWP 24248) "mono" 0x00007ff9395f323a in __waitpid (pid=24253, stat_loc=0x7ffea840ff84, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
  2    Thread 0x7ff937fff700 (LWP 24251) "SGen worker" 0x00007ff9395ee9f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x55996451fb48) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
  3    Thread 0x7ff935bc0700 (LWP 24252) "Finalizer" 0x00007ff9395f16d6 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x559964510d20) at ../sysdeps/unix/sysv/linux/futex-internal.h:205

Thread 3 (Thread 0x7ff935bc0700 (LWP 24252)):
#0  0x00007ff9395f16d6 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x559964510d20) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  do_futex_wait (sem=sem@entry=0x559964510d20, abstime=0x0) at sem_waitcommon.c:111
#2  0x00007ff9395f17c8 in __new_sem_wait_slow (sem=0x559964510d20, abstime=0x0) at sem_waitcommon.c:181
#3  0x0000559964147a88 in ?? ()
#4  0x00005599640fd63b in ?? ()
#5  0x00007ff9395e86db in start_thread (arg=0x7ff935bc0700) at pthread_create.c:463
#6  0x00007ff9390f988f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7ff937fff700 (LWP 24251)):
#0  0x00007ff9395ee9f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x55996451fb48) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x55996451fb60, cond=0x55996451fb20) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=0x55996451fb20, mutex=0x55996451fb60) at pthread_cond_wait.c:655
#3  0x00005599641a8c2a in ?? ()
#4  0x00007ff9395e86db in start_thread (arg=0x7ff937fff700) at pthread_create.c:463
#5  0x00007ff9390f988f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7ff93a194780 (LWP 24248)):
#0  0x00007ff9395f323a in __waitpid (pid=24253, stat_loc=0x7ffea840ff84, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
#1  0x0000559963fe10f3 in ?? ()
#2  0x0000559963fe1295 in ?? ()
#3  0x0000559963f76d2f in ?? ()
#4  0x0000559963ef84e8 in ?? ()
#5  <signal handler called>
#6  0x00007ff935ce48cf in uint16_ToString_string_System_IFormatProvider () from /usr/lib/mono/aot-cache/amd64/mscorlib.dll.so
#7  0x00007ff935ce4830 in ?? () from /usr/lib/mono/aot-cache/amd64/mscorlib.dll.so
#8  0x0000559966686ac0 in ?? ()
#9  0x0000000000000000 in ?? ()

=================================================================
Got a SIGILL while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

Aborted
E: installing Assembly /usr/share/cli-common/policies.d/libgtk2.0-cil/policy.2.8.pango-sharp.dll failed
E: Installation of policy.2.8.pango-sharp with /usr/share/cli-common/runtimes.d/mono failed
dpkg: error processing package mono-gac (--configure):
 installed mono-gac package post-installation script subprocess returned error exit status 29
dpkg: dependency problems prevent configuration of mono-runtime-common:
 mono-runtime-common depends on mono-gac (= 5.18.0.225-0xamarin1+ubuntu1804b1); however:
  Package mono-gac is not configured yet.

dpkg: error processing package mono-runtime-common (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mono-gac
 mono-runtime-common
E: Sub-process /usr/bin/dpkg returned an error code (1)

我省略了大部分输出,因为它重复了相似的行,而且长度较长。

我已经尝试过清除/删除 mono 包,但是无法删除任何内容。我都不能用。apt upgrade我试过dpkg-reconfigure --forcemono-runtime-common,,,。mono-gacca-certificates-monomono-complete

我确实需要帮助。我该如何修复此问题?

答案1

尝试运行:(手动删除有问题的包)

$sudo mv /var/lib/dpkg/info/mono-gac.* /tmp
$sudo mv /var/lib/dpkg/info/mono-runtime-common.* /tmp

然后运行:

$sudo apt update && sudo apt install -f

答案2

尝试运行:

$sudo apt update && sudo apt install -f

如果您仍然遇到同样的问题,我猜您正在使用快照版本存储库,例如:

deb http://download.mono-project.com/repo/ubuntu bionic/snapshots/5.16.0.179 main

修理它, 检查单一项目存储库并按照以下步骤操作:

  1. 清除所有 mono 包

    $sudo apt remove --purge mono* libmono*

  2. 禁用快照版本存储库并添加稳定存储库

    #deb http://download.mono-project.com/repo/ubuntu bionic/snapshots/5.16.0.179 main deb http://download.mono-project.com/repo/ubuntu stable-bionic main

  3. 更新你的 apt 并安装它

    $sudo apt update $sudo apt install mono-complete mono-devel

希望这可以帮助

相关内容