Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
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. –  bkd.online Jan 26 at 23:53
Have you tried reinstalling the 32bit libs using sudo apt-get install ia32-libs or sudo apt-get ia32-libs --reinstall –  Pruitt Jan 27 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 at 12:45
Done so @Braiam –  Sassan Jan 27 at 12:58
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lo‌​cal/games @Rinzwind –  Sassan Jan 27 at 12:59

3 Answers 3

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
share|improve this answer
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 at 13:10
Didn't solve the problem. Everything's still the same and file is still binary not a script. –  Sassan Jan 27 at 13:34
@Sassan are you using a PPA? –  Braiam Jan 27 at 13:38
Yes, I'm using deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu saucy main for wine. –  Sassan Jan 27 at 13:40
@Sassan there's your problem. Remove the ppa and install Ubuntu packages instead. –  Braiam Jan 27 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.

share|improve this answer
It is already installed, reinstalled it and ldd still works the same. –  Sassan Jan 27 at 15:02
@Sassan I updates my answer. Maybe that will work. –  falconer Jan 27 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 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 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 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.

share|improve this answer
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 at 11:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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