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

and*_*der 114 ubuntu x86

我昨天安装了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
Run Code Online (Sandbox Code Playgroud)

我曾经apt-get install ia32-libs在使用Ubuntu 12.04(精确穿山甲)时.但据我所知,自Ubuntu 13.10(Saucy Salamander)以来,Ubuntu已经删除了ia32-libs.我该如何解决这个问题?

Mik*_*der 140

您可以尝试这个来安装32位库(不是所有在ia32-libs中):

sudo  apt-get install program:i386
Run Code Online (Sandbox Code Playgroud)

sudo dpkg --add-architecture i386 可能是必需的(如果你还没有运行过).


或者,如果您想要安装整个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
Run Code Online (Sandbox Code Playgroud)

PS:通过这种方式,您可以安装ia32-libs.但是,我们添加了13.04的源代码,因此,可能存在一些未知问题.安装后ia32-libs,我建议你删除ia32-libs-raring.listin /etc/apt/sources.list.d,并做sudo apt-get update.


如果您想修复Android SDK的依赖关系,可以尝试以下方法:

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

  • E:包'ia32-libs'没有安装候选者 (3认同)
  • Raring存档不再在ubuntu存档上提供.我更改了raring存档以获得精确的存档.包ia32-libs现在将安装. (3认同)
  • 我无法访问archive.ubuntu.com.很多_not found_而`apt-get update`.所以我将包源改为`deb http://old-releases.ubuntu.com/ubuntu/ raring main restricted universe multi verse`.现在它有效. (2认同)

小智 77

安装gcc多个库.

sudo apt-get install gcc-multilib
Run Code Online (Sandbox Code Playgroud)

  • 不能赞成这一点.这个和`libstdc ++ 6-4.7-dev:i386`是从www.modern.ie中提取Internet Explorer虚拟机所必需的. (7认同)
  • 14.04中的这个gcc-multilib元包是迄今为止我遇到的12.04中ia32-libs元包的最接近的替代版本,但它仍然不能满足明确设置为ia32-libs的包依赖性. (2认同)

Ale*_*sei 56

我见过的最好的答案是如何在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
Run Code Online (Sandbox Code Playgroud)

  • 我的adb完全是个问题(装有clockworkmod碳/氦).感谢那个问题的答案(也许不是OP问题,虽然^^).无论如何,这个答案在我看来是更清洁的.没有添加以前的ubuntu版本存储库链接,这将在之后造成大混乱我敢肯定... (2认同)

and*_*der 29

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

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
Run Code Online (Sandbox Code Playgroud)

我不知道我需要安装这些的原因,但它可以在我的电脑上运行.完成这些软件包的安装后,就该尝试了.哦,是的,我需要告诉你.当你想编译代码这个时候,你应该添加-m32之后gcc,例如:gcc -m32 -o hello helloworld.c.只是make cleanmake试.祝你好运的朋友.

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

  • -1:虽然这有效,但**真的很糟糕**练习.在[AskUbuntu帖子](http://askubuntu.com/q/107230/145754)中有更好的解决方案,不需要安装旧的存储库.只有非常旧的二进制包才需要此方法.但是由于你有源代码,这种方法实际上并不合适. (2认同)

wis*_*cky 20

这些替代库对我有用:

sudo apt-get update
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
Run Code Online (Sandbox Code Playgroud)


Bob*_*Bob 17

我遇到了与上面相同的问题,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"   
Run Code Online (Sandbox Code Playgroud)

当我尝试安装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    
Run Code Online (Sandbox Code Playgroud)

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

sudo apt-get install lib32stdc++6
Run Code Online (Sandbox Code Playgroud)


fkp*_*olf 8

对我来说,我必须跑

sudo dpkg --add-architecture i386
Run Code Online (Sandbox Code Playgroud)

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