如何在Ubuntu 14.04 LTS (Trusty Tahr)中安装ia32-libs

时间:2021-06-28 16:12:21

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:

我昨天安装了Ubuntu 14.04 (Trusty Tahr)。一切都好。但是当我尝试编译一些C代码时,我遇到了以下错误。这个错误似乎是由于缺少32位架构支持的操作系统造成的。误差输出如下:

/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?

当我使用Ubuntu 12.04(精确的穿甲弹)时,我使用了安装ia32-libs。但是我知道Ubuntu已经从ubuntu13.10 (Saucy Salamander)中删除了ia32-libs。我该如何解决这个问题?

11 个解决方案

#1


138  

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

您可以尝试安装32位的库(不是所有的ia32-libs):

sudo  apt-get install program:i386

sudo dpkg --add-architecture i386 may be required (if you haven't ever run that).

sudo dpkg——可能需要附加架构i386(如果您从未运行过)。


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

或者,如果您想要安装整个ia32-lib,可以尝试以下顺序:

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

PS: In this way, you can install ia32-libs. However, we add the source of 13.04 instead, so, there may be some unknown problem. After installing ia32-libs, I recommend you to remove the ia32-libs-raring.list in /etc/apt/sources.list.d, and do sudo apt-get update.

PS:通过这种方式,您可以安装ia32-libs。但是,我们添加了13.04的源,所以可能存在一些未知的问题。在安装了ia32-libs之后,我建议您删除ia32- lib- r。在/etc/apt/sources.list上市。d,做sudo apt-get更新。


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

如果你想修复Android SDK的依赖关系,你可以试试下面这个bellow:

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

sudo apt-get安装-y libc6-i386 lib32stdc+ 6 lib32gcc1 lib32ncurses5 lib32z1。

#2


74  

Install gcc multiple library.

安装gcc多个库。

sudo apt-get install gcc-multilib

#3


55  

The best answer I have ever seen is How to run 32-bit applications on Ubuntu 64-bit?

我所见过的最好的答案是如何在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

#4


29  

I got it finally! Here is my way, and I hope it can help you :)

我终于明白了!这是我的方法,我希望它能帮到你。

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

I don't know the reason why I need to install these, but it works on my computer. When you finish installing these packages, it's time to try. Oh yes, I need to tell you. This time when you want to compile your code, you should add -m32 after gcc, for example: gcc -m32 -o hello helloworld.c. Just make clean and make again. Good luck friends.

我不知道我为什么需要安装这些,但是它在我的电脑上运行。当您完成安装这些包时,是时候尝试了。是的,我得告诉你。这一次,当您想要编译代码时,应该在gcc之后添加-m32,例如:gcc -m32 -o hello helloworldc。只要把它弄干净就可以了。祝你好运朋友。

PS: my environment is: Ubuntu 14.04 64-bit (Trusty Tahr) and GCC version 4.8.4. I have written the solution in my blog, but it is in Chinese :-) - How to compass 32bit programm under ubuntu14.04.

我的环境是:Ubuntu 14.04 64位(Trusty Tahr)和GCC版本4.8.4。我已经在我的博客上写了这个解决方案,但它是用中文写的:- - -如何在ubuntu14.04下使用32位程序。

#5


20  

These alternative libraries worked for me:

这些替代图书馆为我工作:

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

#6


16  

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

我遇到了与上面的相同的问题,Eclipse建议安装:

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"   

When I tried to install ia32-libs, Ubuntu prompted to install three other packages:

当我尝试安装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    

With Android Studio and intellij, I also had to install the 32bit version of libstdc++6:

有了Android Studio和intellij,我还不得不安装了32位版本的libstdc++6:

sudo apt-get install lib32stdc++6

#7


6  

For me, I have to run

对我来说,我必须跑步。

sudo dpkg --add-architecture i386

before running Mike Tang's answer. Otherwise, I can't install ia32-libs.

在运行Mike Tang的回答之前。否则,我无法安装ia32-libs。

#8


4  

Simply install the 32-bit version of the program, instead of the 64-bit version.

只需安装程序的32位版本,而不是64位版本。

This is much safer than installing packages that are not intended for the distribution at hand.

这比安装那些不打算分发的包要安全得多。

I got this suggestion from the Google Earth installation instructions for Ubuntu 14.04. Google Earth used to employ ia32-libs under 64-bit Ubuntu 12.04.

我从谷歌的Ubuntu 14.04安装说明中得到了这个建议。谷歌在64位Ubuntu 12.04下使用了ia32-libs。

Quoting webupd8.org:

引用webupd8.org:

The ia32-libs package is no longer available in Ubuntu, starting with Ubuntu 13.10. The package was superseded by multiarch support so you don't need it any more, but some 64bit packages (which are actually 32bit applications) still depend on this package and because of this, they can't be installed in Ubuntu 14.04 or 13.10, 64bit. [...]

从Ubuntu 13.10开始,ia32-libs包不再在Ubuntu中可用。这个包被multiarch支持所取代,所以你不再需要它了,但是一些64位的包(实际上是32位应用程序)仍然依赖于这个包,因此,它们不能安装在Ubuntu 14.04或13.10,64位。[…]

The "fix" or more specifically the correct way of installing these apps which depend on ia32-libs is to simply install the 32bit package on Ubuntu 64bit. Of course, that will install quite a few 32bit packages, but that's how multiarch works.

“fix”或者更确切地说,安装这些依赖于ia32-libs的应用程序的正确方法就是在Ubuntu 64位上安装32位包。当然,这将安装相当多的32位包,但这就是多弓的工作方式。

The problem with some programs (like Google Earth) is that the 32-bit package does not support multiarch. Consequently, some 32-bit dependencies need to be installed manually to make the 32-bit version of the program run on Ubuntu 64-bit.

一些程序(如谷歌Earth)的问题在于,32位的包不支持multiarch。因此,需要手动安装一些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

#9


2  

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

If you are in China, you can modify "raring" to "precise" (for Ubuntu 13.04 (Raring Ringtail) and Ubuntu 12.04 LTS (Precise Pangolin), respectively). I installed Beyond Compare on Ubuntu 14.04 (Trusty Tahr).

如果你在中国,你可以把“r”改成“精确”(Ubuntu 13.04 (rringtail)和Ubuntu 12.04 LTS(精确穿山甲)。我安装在Ubuntu 14.04 (Trusty Tahr)上。

#10


1  

The problem is that in many cases the packages are multiarch already so the i386 package is not available, but other packages still depend on the i386 package only. This is a problem in the repository, and the managers of the repos should fix it

问题是,在很多情况下,包是多足的,所以i386包是不可用的,但是其他的包仍然依赖于i386包。这是存储库中的一个问题,而repos的管理人员应该修复它。

#11


0  

A solution is add the corresponding Debian package way to your repository. For this, type the below commands:

解决方案是将相应的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

The first line writes in the end of the sources.list file the package way. This works for me. I wish that helps you.

第一行写在源的末尾。列出文件包的方式。这适合我。我希望这能帮助你。

#1


138  

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

您可以尝试安装32位的库(不是所有的ia32-libs):

sudo  apt-get install program:i386

sudo dpkg --add-architecture i386 may be required (if you haven't ever run that).

sudo dpkg——可能需要附加架构i386(如果您从未运行过)。


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

或者,如果您想要安装整个ia32-lib,可以尝试以下顺序:

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

PS: In this way, you can install ia32-libs. However, we add the source of 13.04 instead, so, there may be some unknown problem. After installing ia32-libs, I recommend you to remove the ia32-libs-raring.list in /etc/apt/sources.list.d, and do sudo apt-get update.

PS:通过这种方式,您可以安装ia32-libs。但是,我们添加了13.04的源,所以可能存在一些未知的问题。在安装了ia32-libs之后,我建议您删除ia32- lib- r。在/etc/apt/sources.list上市。d,做sudo apt-get更新。


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

如果你想修复Android SDK的依赖关系,你可以试试下面这个bellow:

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

sudo apt-get安装-y libc6-i386 lib32stdc+ 6 lib32gcc1 lib32ncurses5 lib32z1。

#2


74  

Install gcc multiple library.

安装gcc多个库。

sudo apt-get install gcc-multilib

#3


55  

The best answer I have ever seen is How to run 32-bit applications on Ubuntu 64-bit?

我所见过的最好的答案是如何在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

#4


29  

I got it finally! Here is my way, and I hope it can help you :)

我终于明白了!这是我的方法,我希望它能帮到你。

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

I don't know the reason why I need to install these, but it works on my computer. When you finish installing these packages, it's time to try. Oh yes, I need to tell you. This time when you want to compile your code, you should add -m32 after gcc, for example: gcc -m32 -o hello helloworld.c. Just make clean and make again. Good luck friends.

我不知道我为什么需要安装这些,但是它在我的电脑上运行。当您完成安装这些包时,是时候尝试了。是的,我得告诉你。这一次,当您想要编译代码时,应该在gcc之后添加-m32,例如:gcc -m32 -o hello helloworldc。只要把它弄干净就可以了。祝你好运朋友。

PS: my environment is: Ubuntu 14.04 64-bit (Trusty Tahr) and GCC version 4.8.4. I have written the solution in my blog, but it is in Chinese :-) - How to compass 32bit programm under ubuntu14.04.

我的环境是:Ubuntu 14.04 64位(Trusty Tahr)和GCC版本4.8.4。我已经在我的博客上写了这个解决方案,但它是用中文写的:- - -如何在ubuntu14.04下使用32位程序。

#5


20  

These alternative libraries worked for me:

这些替代图书馆为我工作:

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

#6


16  

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

我遇到了与上面的相同的问题,Eclipse建议安装:

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"   

When I tried to install ia32-libs, Ubuntu prompted to install three other packages:

当我尝试安装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    

With Android Studio and intellij, I also had to install the 32bit version of libstdc++6:

有了Android Studio和intellij,我还不得不安装了32位版本的libstdc++6:

sudo apt-get install lib32stdc++6

#7


6  

For me, I have to run

对我来说,我必须跑步。

sudo dpkg --add-architecture i386

before running Mike Tang's answer. Otherwise, I can't install ia32-libs.

在运行Mike Tang的回答之前。否则,我无法安装ia32-libs。

#8


4  

Simply install the 32-bit version of the program, instead of the 64-bit version.

只需安装程序的32位版本,而不是64位版本。

This is much safer than installing packages that are not intended for the distribution at hand.

这比安装那些不打算分发的包要安全得多。

I got this suggestion from the Google Earth installation instructions for Ubuntu 14.04. Google Earth used to employ ia32-libs under 64-bit Ubuntu 12.04.

我从谷歌的Ubuntu 14.04安装说明中得到了这个建议。谷歌在64位Ubuntu 12.04下使用了ia32-libs。

Quoting webupd8.org:

引用webupd8.org:

The ia32-libs package is no longer available in Ubuntu, starting with Ubuntu 13.10. The package was superseded by multiarch support so you don't need it any more, but some 64bit packages (which are actually 32bit applications) still depend on this package and because of this, they can't be installed in Ubuntu 14.04 or 13.10, 64bit. [...]

从Ubuntu 13.10开始,ia32-libs包不再在Ubuntu中可用。这个包被multiarch支持所取代,所以你不再需要它了,但是一些64位的包(实际上是32位应用程序)仍然依赖于这个包,因此,它们不能安装在Ubuntu 14.04或13.10,64位。[…]

The "fix" or more specifically the correct way of installing these apps which depend on ia32-libs is to simply install the 32bit package on Ubuntu 64bit. Of course, that will install quite a few 32bit packages, but that's how multiarch works.

“fix”或者更确切地说,安装这些依赖于ia32-libs的应用程序的正确方法就是在Ubuntu 64位上安装32位包。当然,这将安装相当多的32位包,但这就是多弓的工作方式。

The problem with some programs (like Google Earth) is that the 32-bit package does not support multiarch. Consequently, some 32-bit dependencies need to be installed manually to make the 32-bit version of the program run on Ubuntu 64-bit.

一些程序(如谷歌Earth)的问题在于,32位的包不支持multiarch。因此,需要手动安装一些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

#9


2  

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

If you are in China, you can modify "raring" to "precise" (for Ubuntu 13.04 (Raring Ringtail) and Ubuntu 12.04 LTS (Precise Pangolin), respectively). I installed Beyond Compare on Ubuntu 14.04 (Trusty Tahr).

如果你在中国,你可以把“r”改成“精确”(Ubuntu 13.04 (rringtail)和Ubuntu 12.04 LTS(精确穿山甲)。我安装在Ubuntu 14.04 (Trusty Tahr)上。

#10


1  

The problem is that in many cases the packages are multiarch already so the i386 package is not available, but other packages still depend on the i386 package only. This is a problem in the repository, and the managers of the repos should fix it

问题是,在很多情况下,包是多足的,所以i386包是不可用的,但是其他的包仍然依赖于i386包。这是存储库中的一个问题,而repos的管理人员应该修复它。

#11


0  

A solution is add the corresponding Debian package way to your repository. For this, type the below commands:

解决方案是将相应的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

The first line writes in the end of the sources.list file the package way. This works for me. I wish that helps you.

第一行写在源的末尾。列出文件包的方式。这适合我。我希望这能帮助你。