apt-get - 分段错误:错误处理包 libc-bin

Erd*_*ase 6 package-management apt segmentation-fault libraries

嗨,我在过去的一个月里一直在为此苦苦挣扎。

sudo apt-get upgradesudo apt-get autoremove因以下错误而出错

E: Unmet dependencies. Try using -f.
Run Code Online (Sandbox Code Playgroud)

当我运行时sudo apt-get install -f,它出现如下错误。

Fetched 30.2 MB in 32s (928 kB/s)                                              
Preconfiguring packages ...
Setting up libc-bin (2.23-0ubuntu9) ...
Segmentation fault
/sbin/ldconfig.real: Can't stat /lib/i686-linux-gnu: No such file or directory
/sbin/ldconfig.real: Can't stat /usr/lib/i686-linux-gnu: No such file or directory
/sbin/ldconfig.real: Path `/usr/local/lib' given more than once
/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: Path `/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
Segmentation fault
dpkg: error processing package libc-bin (--configure):
 subprocess installed post-installation script returned error exit status 139
Errors were encountered while processing:
 libc-bin
E: Sub-process /usr/bin/dpkg returned an error code (1)
Run Code Online (Sandbox Code Playgroud)

1)问题发布在这里链接。但提到的答案是特定于用户的。

2)正如这里提到的链接,我试过了sudo apt-get --reinstall install libc-bin。但这显示

E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
Run Code Online (Sandbox Code Playgroud)

3)sudo dpkg --configure -a 错误如下

Errors were encountered while processing:
 libosmesa6:i386
 libgl1-mesa-dri:i386
 libglapi-mesa:i386
 libgl1-mesa-glx:amd64
 libgl1-mesa-glx:i386
 libegl1-mesa:amd64
 xserver-xephyr
 xserver-xorg-core
 libgl1-mesa-dev:i386
 libwayland-egl1-mesa:amd64
Run Code Online (Sandbox Code Playgroud)

任何帮助将不胜感激,因为这是一台配置了我所有学术项目的机器,因此无法重新安装。

编辑:

4)sudo dpkg --configure -D 777 libc-bin给出以下输出:

D000001: ensure_diversions: new, (re)loading
D000001: process queue pkg libc-bin:amd64 queue.len 0 progress 1, try 1
D000040: checking dependencies of libc-bin:amd64 (- <none>)
D000400:   checking group ...
D000400:     checking possibility  -> libc6
D000400:       checking non-provided pkg libc6:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> libc6
D000400:       checking non-provided pkg libc6:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000040: ok 2 msgs >><<
D000040:     checking Breaks
D000400:       checking breaker locales:all virtbroken <none>
Setting up libc-bin (2.23-0ubuntu9) ...
D000002: fork/exec /var/lib/dpkg/info/libc-bin.postinst ( configure 2.23-0ubuntu9 )
Segmentation fault
/sbin/ldconfig.real: Can't stat /lib/i686-linux-gnu: No such file or directory
/sbin/ldconfig.real: Can't stat /usr/lib/i686-linux-gnu: No such file or directory
/sbin/ldconfig.real: Path `/usr/local/lib' given more than once
/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: Path `/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
Segmentation fault
dpkg: error processing package libc-bin (--configure):
 subprocess installed post-installation script returned error exit status 139
D000001: ensure_diversions: same, skipping
Errors were encountered while processing:
 libc-bin
Run Code Online (Sandbox Code Playgroud)

编辑:

5)我正在尝试这里提到的解决方案链接。但sudo mv /usr/lib/x86_64-linux-gnu/libtic.so.5.9 /root给出了错误

mv: cannot stat '/usr/lib/x86_64-linux-gnu/libtic.so.5.9': No such file or directory
Run Code Online (Sandbox Code Playgroud)

这是否意味着在我的情况下是其他一些图书馆导致了这个问题?

编辑:我能够在此期间执行 stracesudo apt-get install -f并且可以在此处获得日志;如果这对任何人有帮助。

6)我尝试增加这里提到的 APT 缓存限制。但它没有帮助。

编辑更新 对 Elder Geek 建议的回答

7) 我已经用 memtest 测试了我的 ram,它没有显示任何错误。我还在我的硬盘驱动器上进行了 SMART 自检(短),显示“磁盘正常”。

8)我已经手动检查过,这个特定的库/usr/lib/x86_64-linux-gnu/libtic.so.5.9在该位置不存在。(所以我相信我的系统中不存在这样的库,而其他一些库导致了这个问题。)

9)/usr/lib/i686-linux-gnu我的系统中没有路径。

10)有一个错字,我正在检查/etc/apt/sources.lst原始答案中提到的。我有一个sources.list.

这些是我可以在那里看到的条目。我没有看到那里提到任何 ppa。

deb http://archive.canonical.com/ubuntu xenial partner
# deb-src http://archive.canonical.com/ubuntu trusty partner
deb http://archive.ubuntu.com/ubuntu xenial main universe restricted
deb http://security.ubuntu.com/ubuntu/ xenial-security main restricted universe
deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe
deb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe
Run Code Online (Sandbox Code Playgroud)

此外,我无法安装任何 ppa 管理器,因为 apt 本身已损坏,我无法安装任何东西。

11) 附加信息:这原本是一个 14.04 系统,后来升级到 16.04。我在 14.04 中拥有的那些 ppa 在升级期间被禁用。然而,这次升级发生在将近一年前,系统已经平稳运行了将近一年。

12)最后也是最重要的:我记得sudo apt-get dist-upgrade在所有问题开始出现之前进行了一段时间。这可能是导致问题的原因吗?

Eld*_*eek 3

虽然分段错误通常与尝试访问内存受限区域的编写不当的代码有关,但我不认为这是问题的原因。虽然这种情况并不常见,但这些故障也可能是由硬件行为不当引起的。首先,我将通过在系统上运行memtest来确保您拥有稳定的环境,并确保您的硬盘在使用交换时状态良好。如果您发现有故障的硬件,请更换它。

无法统计

意味着该文件或目录不存在,或者您的用户即使通过 sudo 也无权访问它。您可以通过ls -l /lib/i686-linux-gnu命令检查权限。因为/usr/lib/i686-linux-gnu我在 64 位版本的 Ubuntu 中找不到(假设基于Path /usr/lib/x86_64-linux-gnu given more than once)。

根据您提供的信息,我的最佳评估是,其中一些错误的根本原因是您的软件源中的条目不正确。这些可以在/etc/apt/sources.lst文件或目录的列表中找到/etc/apt/sources.list.d。您可能会开始尝试清理它,如何删除 PPA?

如果您运行的是带有 GUI 的桌面,您可能更喜欢Y PPA Manager,它是执行此类任务的有用工具。

如果这个答案有任何令人困惑或不清楚的地方,请发表评论,我会尽力澄清。

编辑:进一步评估以涵盖自该答案最初撰写以来提出的其他观点。

7)在没有故障硬件的情况下,我们需要更深入地挖掘

8) 从第 5 点开始就非常清楚了。

9) 从第 4 点开始也很清楚。

重新编辑10) 拥有有效的 /etc/apt/sources.list 意味着您不需要替换它。

11)我的系统也从 14.04 升级到 16.04,我的 /etc/apt/sources.list 仍然完好无损,正如您现在报告的那样。

12)根据甜点在此评论中提到的错误,这似乎是可能的

此时,选择是有限的。在这里,它们没有特定的顺序。请随意选择看起来最不痛苦的一个。

1) 恢复到之前的备份

2)备份用户数据(无论如何你都应该这样做)并从头开始安装

3) 修复您的安装。下载apt 及其所有依赖项并重新安装它们dpkg -i packagename