恢复损坏的 Ubuntu

恢复损坏的 Ubuntu

情况:有一天我的 SSD 硬盘出现故障,随机删除了许多文件,包括一些操作系统文件。损坏严重到操作系统无法启动,甚至无法 chroot。

幸运的是,我在另一张光盘上还有另一个 Ubuntu,我能够恢复chroot损坏的操作系统,然后启动和网络功能。然后我启动了损坏的操作系统并运行一个脚本,重新安装了安装在其上的每个软件包(使用apt-get install <package> --reinstall),这并不像我描述的那么简单,有很多软件包需要特别注意。

之后,除了运行 wine 和 adb 等 32 位二进制文​​件外,几乎一切都很好。我需要该领域的专家告诉我应该怎么做才能恢复执行 32 位二进制文​​件。

例如假设我想运行 wine:首先让我们运行它fish

# wine
Failed to execute process '/usr/bin/wine'. Reason:
The file '/usr/bin/wine' does not exist or could not be executed.

现在让我们运行它bash

# wine
bash: /usr/bin/wine: No such file or directory

让我们输入完整位置:

# whereis wine
wine: /usr/bin/wine /usr/bin/X11/wine /usr/share/wine /usr/share/man/man1/wine.1.gz
# /usr/bin/wine
bash: /usr/bin/wine: No such file or directory

让我们看看该文件是否真的存在:

# ls -l /usr/bin/wine
-rwxr-xr-x 1 root root 9748 Dec 18 05:11 /usr/bin/wine

ldd说什么file

# ldd /usr/bin/wine
    not a dynamic executable
# file /usr/bin/wine
/usr/bin/wine: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0xe4e2fb58bdbbbc2dedf7483825900ed35a6dc989, stripped

如何解决这个问题?

损坏的操作系统是Ubuntu 13.10 amd64。

答案1

ldd由于“二进制”只是一个脚本,因此结果是预期的:

$ file /usr/bin/wine
/usr/bin/wine: POSIX shell script, ASCII text executable
$ head /usr/bin/wine 
#!/bin/sh

set -e

wine=/usr/bin/wine32
if test "$(file -b -L "$1" | cut -d\  -f1)" = "PE32+" -o "$WINEARCH" = "win64"; then
    wine=/usr/bin/wine64
fi

if test -f $wine; then

那么,解决方案是什么? 将它们完全移除并安装。 我们真的不知道损坏程度有多大,因此移除并重新安装是最安全的:

sudo apt-get autoremove --purge wine

任何无法正常工作的软件包都一样。您可以使用以下命令验证与二进制文件相对应的软件包dpkg -S

➜  ~  dpkg -S /usr/bin/wine
wine: /usr/bin/wine

答案2

跑步

sudo apt-get install libopenal1:i386

或者

sudo apt-get install --reinstall libopenal1:i386

至少这应该可以让它ldd表现良好。我不知道这是否会解决其他问题,也许会。如果不能,那么我只会查看输出ldd,然后安装/重新安装包含这些库的软件包。


答案3

你可以使用雷斯卡图克斯修复损坏的机器。您可以使用网启动。希望这能解决您的问题。

相关内容