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

前端 未结 11 2591
臣服心动
臣服心动 2020-11-28 18:01

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

相关标签:
11条回答
  • 2020-11-28 18:26

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

    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.

    0 讨论(0)
  • 2020-11-28 18:27

    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"   
    

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

    $ 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:

    sudo apt-get install lib32stdc++6
    
    0 讨论(0)
  • 2020-11-28 18:27

    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

    0 讨论(0)
  • 2020-11-28 18:31

    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.

    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.

    0 讨论(0)
  • 2020-11-28 18:31

    These alternative libraries worked for me:

    sudo apt-get update
    sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
    
    0 讨论(0)
  • 2020-11-28 18:35

    For me, I have to run

    sudo dpkg --add-architecture i386
    

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

    0 讨论(0)
提交回复
热议问题