I basically have two questions:

  1. How do you install 32-bit Python alongside 64-bit Python on linux?
  2. How do I fix my broken system from the failed attempt below?

I just tried to install a 32-bit python alongside my 64-bit python on Linux Mint 16. It's not as straight forward as I hoped for (something like sudo apt-get install python32 would be nice) but after a bit of googling I downloaded Python 2.7.6 and did the following:

sudo apt-get install ia32-libs gcc-multilib checkinstall
CC="gcc -m32" LDFLAGS="-L/lib32 -L/usr/lib32 -Lpwd/lib32 -Wl,-rpath,/lib32 -Wl,-rpath,/usr/lib32" ./configure --prefix=/opt/pym32
sudo checkinstall

The should supposedly make me able to run 32-bit or 64-bit (default) like this:

python -c 'import sys; print sys.maxint'
/opt/pym32/bin/python -c 'import sys; print sys.maxint'

... but /opt/pym32/ wasn't even created. Worse, my system now reports 29 broken dependencies, indicating that the new python replaced the old one or something like that. To fix it, aptitude suggests that I remove a whole bunch of packages that I need and install a whole bunch of packages that I don't need.

I used checkinstall rather than make install to be able to reverse/uninstall if something went wrong, but uninstalling/reinstalling python won't work because of the broken dependencies. Is there a way to get out of this mess?


1 Answer 1


32-bit packages on 64-bit platform

First of all you need to allow your package manager to install packages with different architecture. But who is who? Apt is simple combination of wget and dpkg. The real package manager is dpkg, which provides low-level infrastructure for handling operations with real *.deb packages.

So, lets see available architectures for our particular case:

dpkg-architecture --list-known | grep -E "amd64|i386"


dpkg-architecture --list-known | ack "amd64|i386"

As you can see, in our case architectures are amd64 and i386. Now you can allow package manager to install i386 packages:

sudo dpkg --add-architecture i386

Now you can install your packages:

sudo aptitude update && sudo aptitude install python2.7:i386

Typically, first i386 package install results in installing a lot of dependency-packages. For example, on my Debian x86_64 GNU/Linux testing (stretch) installing skype (which depends on libc6:i386) results in installing 189 packages:

dpkg --get-selections | ack i386 -c

The problem is that python2.7:i386 conflicts with python2.7 and a lot of packages depends on python2.7. So, you wont be able to install python2.7:i386 without removing all graphical environment.

Fix broken dependencies

This is simple one:

sudo apt-get install -f && sudo dpkg --configure -a

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .