Situation: One day my SSD hard failed and deleted many files randomly, consisting some files of the OS. Damage was big enough that made the OS unable to boot and even unable to chrooted.

Fortunately I had another Ubuntu on another disc and I was able to recover chroot and then boot and network functionality of damaged OS. Then I booted the damaged OS and ran a script that reinstalled every package installed on it (with apt-get install <package> --reinstall) it wasn't as easy as I'm describing it, there were lots of packages that needed specific attention.

After that almost everything's fine except running 32bit binaries like wine and adb. I need an expert in this field to tell me what should I do to recover executing 32bit binaries.

For example suppose that I wanna run wine: First lets run it on fish:

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

Now lets run it on bash:

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

Lets enter the full location:

# 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

Lets see if the file really exists:

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

What ldd and file say:

# 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

How to solve this?

Damaged OS is Ubuntu 13.10 amd64.

  • when you do apt-get --reinstall for 32bit binaries, what happens? What do you mean by "except running 32bit binaries like wine and adb"? Technically, they should be no different than the usual 64bit binaries as far as this situation is concerned. Can you elaborate more on the quoted words please. – Bhavin Doshi Jan 26 '14 at 23:53
  • Have you tried reinstalling the 32bit libs using sudo apt-get install ia32-libs or sudo apt-get ia32-libs --reinstall – chj1axr0 Jan 27 '14 at 11:24
  • apt-get --reinstall works and doesn't report any problem. The problem is that I can't "run" wine nor adb nor scrivener nor some other 32-bit binaries. When I try to rum them in bash it says: Failed to execute process '/usr/bin/wine'. Reason: The file '/usr/bin/wine' does not exist or could not be executed. But the file is there and it's executable. When I try to ldd it, ldd says: not a dynamic executable @Braiam @bkd.online – Sassan Jan 27 '14 at 12:45
  • Done so @Braiam – Sassan Jan 27 '14 at 12:58
  • /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games @Rinzwind – Sassan Jan 27 '14 at 12:59

The ldd results are expected, since the "binary" is just an script:

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

set -e

if test "$(file -b -L "$1" | cut -d\  -f1)" = "PE32+" -o "$WINEARCH" = "win64"; then

if test -f $wine; then

So, what's the solution? Remove them completely and install them. We don't really know how much damage is there so removing and reinstalling is the most safest:

sudo apt-get autoremove --purge wine

The same with any package that doesn't work. You can verify the package that correspond to the binary using dpkg -S:

➜  ~  dpkg -S /usr/bin/wine
wine: /usr/bin/wine
  • For me it wasn't a script, it was an ELF32 binary, maybe because I'm using wine1.6-i386, anyway I purged it and am reinstalling it though I think I've already did so. Lets see what happens. – Sassan Jan 27 '14 at 13:10
  • Didn't solve the problem. Everything's still the same and file is still binary not a script. – Sassan Jan 27 '14 at 13:34
  • @Sassan are you using a PPA? – Braiam Jan 27 '14 at 13:38
  • Yes, I'm using deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu saucy main for wine. – Sassan Jan 27 '14 at 13:40
  • 2
    @Sassan there's your problem. Remove the ppa and install Ubuntu packages instead. – Braiam Jan 27 '14 at 13:52


sudo apt-get install libopenal1:i386


sudo apt-get install --reinstall libopenal1:i386

At least this should make ldd behave well. I don't know if this will solve the other problems, it might. If not then I would just look at the ldd output, and install/reinstall the packages which contains those libraries.

  • It is already installed, reinstalled it and ldd still works the same. – Sassan Jan 27 '14 at 15:02
  • @Sassan I updates my answer. Maybe that will work. – falconer Jan 27 '14 at 15:12
  • After doing so install libc6 failed, my Ubuntu stopped working so I rebooted my machine. Though I was unable to chroot it I copied some libraries and was able to boot it. Now I don't have my mouse pointer which makes things really bad. When I try to reinstall libc it says: dpkg: error processing <address of package> (--unpack): subprocess new pre-installation script returned error exit status 1\n No apport written because MaxReports is reached already\n... – Sassan Jan 27 '14 at 17:39
  • @Sassan Oh fok. I'm so sorry. I didn't thought that installing an i386 package will break your 64 bit system. The bash: /usr/bin/wine: No such file or directory message means that one or more 32 bit libraries which are linked to the executable are missing. (The no such file or directors is referring to this missing shared library.) The ldd not working I thought means that one of the libopenal1:i386 dependency is missing/broken. I have no clue what did that 32 bit library broke in a 64 bit system. I would downvote my answer If I could. :(( I remove those lines, so no anyone else runs it. – falconer Jan 27 '14 at 17:52
  • @Sassan Though I don't know that this problem is might be related to your original problem which caused your previous system crash which you were repairing now. – falconer Jan 27 '14 at 17:53

You could use Rescatux for repairing your broken machine. You can make it to bootable usb using Unetbootin. Hope this could solve your issue.

  • It seems to be good tool for issues like grub failures and fs problems, but as I mentioned in the question I solved these issues. My problem was about repairing broken libraries and I gave up (I don't have the damage ubuntu anymore), thanks anyway. – Sassan Jan 30 '14 at 11:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.