How to run 32-bit app in Ubuntu 64-bit?

I installed Ubuntu 14.04 and the current Android development SDK, which contains 32-bit executables. I found that I cannot run those 32-bit binaries. Trying to start them from bash gives me an error:

thomas@thinkpad$ ./adb

bash: ./adb: No such file or directory

It is there though:

thomas@thinkpad$ ls -al ./adb

-rwxrwxrwx 1 thomas thomas 1231255 Jan 17 13:31 ./adb

thomas@thinkpad$ file ./adb

./adb: ELF 32-bit LSB  executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, not stripped. Same symptom for all the other 32-bit tools in the Android SDK. 

In olden days one could just install 32-bit libraries on 64-bit Ubuntu to get 32-bit support, but that does not seem to work anymore.

How do I run 32-bit apps on a 64-bit Ubuntu 14.04?

share improve this question
 
up vote 68 down vote accepted

To run a 32-bit executable file on a 64-bit multi-architecture Ubuntu system, you have to add the i386 architecture and install the three library packages libc6:i386, libncurses5:i386, and libstdc++6:i386:

sudo dpkg --add-architecture i386

Or if you are using Ubuntu 12.04 LTS (Precise Pangolin) or below, use this:

echo "foreign-architecture i386" > /etc/dpkg/dpkg.cfg.d/multiarch

Then:

sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386

After these steps, you should be able to run the 32-bit application:

./example32bitprogram
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值