How to install ia32-libs in Ubuntu 14.04 LTS (Trusty Tahr)

I installed Ubuntu 14.04 (Trusty Tahr) yesterday. Everything seems OK. But when I tried to compile some C code, I encounter the following error. The error seems to be due to the OS lacking the 32-bit architecture support. The error output is as following:

/usr/bin/ld: i386 architecture of input file `./libsc.a(ftl_msg.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `./libsc.a(libsc_debug.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `./libsc.a(libsc_str.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `./libsc.a(libsc_cfg_common.o)' is incompatible with i386:x86-64 output

I used to apt-get install ia32-libs when I was using Ubuntu 12.04 (Precise Pangolin). But what I know is that Ubuntu has removed the ia32-libs since Ubuntu 13.10 (Saucy Salamander). How can I fix this problem?

426123 次浏览

You can try this to install the 32-bit library (not all in ia32-libs):

sudo  apt-get install program:i386

可能需要 sudo dpkg --add-architecture i386(如果您从未运行过它)。


Or if you want to install the whole ia32-lib instead, try the following order:

sudo -i
cd /etc/apt/sources.list.d
echo "deb http://old-releases.ubuntu.com/ubuntu/ raring main restricted universe multiverse" >ia32-libs-raring.list
apt-get update
apt-get install ia32-libs

这样,你就可以安装 ia32-libs了。但是,我们添加了13.04的源代码,因此,可能存在一些未知的问题。在安装 ia32-libs之后,我建议您删除 /etc/apt/sources.list.d中的 ia32-libs-raring.list,并执行 sudo apt-get update


If you want to fix the dependency of Android SDK, you can try this bellow:

sudo apt-get install -y libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1

我终于明白了! 这是我的方法,我希望它能帮助你:)

sudo apt-get install libc6:i386
sudo -i
cd /etc/apt/sources.list.d
echo "deb http://old-releases.ubuntu.com/ubuntu/ raring main restricted universe multiverse" >ia32-libs-raring.list
apt-get update
apt-get install ia32-libs
rm /etc/apt/sources.list.d/ia32-libs-raring.list
apt-get update
exit
sudo apt-get install gcc-multilib

我不知道为什么我需要安装这些,但它可以在我的电脑上工作。安装完这些软件包后,就可以尝试了。是的,我得告诉你。这一次,当您想要编译代码时,您应该在 gcc之后添加 -m32,例如: gcc -m32 -o hello helloworld.c。又是 make cleanmake。祝你们好运,朋友们。

PS: 我的环境是: Ubuntu 14.0464位(Trusty Tahr)和 GCC 4.8.4版。我已经在我的博客中写了解决方案,但它是中文的: ——)-如何在 ubuntu14.04下指南针32位程序

For me, I have to run

sudo dpkg --add-architecture i386

在运行 Mike Tang 的答案之前。否则,我不能安装 ia32-libs。

安装 gcc 多重库。

sudo apt-get install gcc-multilib

只需安装32位版本的程序, 代替64位版本。

这比安装不适用于当前发行版的软件包要安全得多。

我从 Ubuntu 14.04的谷歌地球安装说明得到这个建议。 Google Earth 曾经在64位 Ubuntu 12.04下使用 ia32-libs

引用 Webpd8.org:

Ia32-libs 包在 Ubuntu 中不再可用,从 Ubuntu 13.10的软件包已经被 multiarch 支持所取代 不再需要它了,但是一些64位的软件包(实际上 32位应用程序)仍然依赖于这个包,因此, 它们不能安装在 Ubuntu 14.04或13.10、64位上

“修复”或更具体地说,正确的方式安装这些 依赖 ia32-libs 的应用程序只需要安装32位软件包 在 Ubuntu 64位上。当然,这将安装相当多的32位 但这就是 multiarch 的工作原理。

The problem with some programs (like Google Earth) is that the 32-bit package does not 支撑多足弓。因此,需要手动安装一些32位的依赖项,以使32位版本的程序在 Ubuntu 64位上运行。

sudo dpkg --add-architecture i386 # only needed once
sudo apt-get update
sudo apt-get install libfontconfig1:i386 libx11-6:i386 libxrender1:i386 libxext6:i386 libgl1-mesa-glx:i386 libglu1-mesa:i386 libglib2.0-0:i386 libsm6:i386

问题在于,在许多情况下,软件包已经是 multiarch,所以 i386软件包不可用,但是其他软件包仍然只依赖于 i386软件包。这是存储库中的一个问题,回购的管理人员应该解决这个问题

这些替代图书馆对我很有用:

sudo apt-get update
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6

我见过的最好的答案是 如何在 Ubuntu 64位上运行32位应用程序

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
sudo ./adb
sudo -i
cd /etc/apt/sources.list.d
echo "deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse" >ia32-libs-raring.list
apt-get update
apt-get install ia32-libs
rm /etc/apt/sources.list.d/ia32-libs-raring.list
apt-get update
exit

如果您在中国,您可以将“ Raring”修改为“ Precision”(分别用于 Ubuntu 13.04(Raring Ringtail)和 Ubuntu 12.04 LTS (精确穿山甲))。我在 Ubuntu 14.04(Trusty Tahr)上安装了 无与伦比

I had the same problem as above and Eclipse suggested installing:

Hint: On 64-bit systems, make sure the 32-bit libraries are installed:
"sudo apt-get install ia32-libs"
or on some systems,
"sudo apt-get install lib32z1"

当我试图安装 ia32-libs 时,Ubuntu 提示我安装另外三个软件包:

$ sudo apt-get install ia32-libs
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
lib32z1 lib32ncurses5 lib32bz2-1.0


E: Package 'ia32-libs' has no installation candidate
$
$ sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0

使用 Android Studio 和 intellij,我还必须安装32位版本的 libstdc + + 6:

sudo apt-get install lib32stdc++6

解决方案是将相应的 Debian包方式添加到存储库中:

echo "deb ftp.us.debian.org/debian wheezy main" >> /etc/apt/sources.list
sudo apt-get update
sudo apt-get install ia32-libs-i386

第一行以包的方式写在 sources.list文件的末尾。 这对我有用,我希望这能帮到你。