Αναζήτηση αυτού του ιστολογίου

Debian : Install 32bit programms in 64bit distro

Installing 32bit applications in 64bit distro.
Also see the Debian Wiki MultiArch Howto (multi architecture) set ups.

When i tried to install 32bit apps (i.e Kega Fusion, Teamviwer) in 64bit distros, i run into trouble.


General Concept for 32bit apps installation:
First you have to declare that your system will be supporting both architectures (arch). 
To do this in command line just run dpkg --add-architecture i386
Then you need to apt-get update & upgrade
Once architecture i386 is added, every future update will include i386 updates.
This is somehow hdd space consuming, since an available update is installed twice (one time for amd64 and a second package for i386 is also installed).
To ensure that this will happen, you have to edit the sources.list file by adding [arch=amd64,i386] in front of every entry just after the deb word (see debian wiki).

Also notice that installation of 32bit packages available in repos, can be done using apt-get install package:i386

The problems:
Let's say you want to install Teamviewer using a deb file downloaded by teamviewer web site.
When i tried to install this .deb file using gdebi i got various dependency errors for missing 32bit libraries. This was a surprise, since gdebi has usually the abillity to install missing files in order dependencies to be satisfied. But not in my case.
I assume the reason was that i have enabled testing and unstable repos in my debian, and as a result we had somewhere a conflict of package versions that gdebi could not automatically resolve, because it seems that there is a secret for multi arch setup: 
In order to be able to install a 32bit package of version XX, you must have installed the corresponding 64bit version of the same package in the same version.

Since gdebi was not usefull in our case i used dpkg -i application.deb and i also got a list of missing dependencies.
Next step to install all missing libraries/dependencies manually with apt-get package:i386

Here is the trick:
In some "critical" packages, apt-get wants to remove almost my whole system (i.e mate-desktop (!!!), etc) to be able to install a critical 32bit package.

Work around:
Instead of following apt-get instructions for removing almost everything (thank's god for not following them!) , you can 
#apt-get download applicationname.
This will download the required package in the directory you currently are, as a .deb file (use ls after download to see the deb file).
Next step is to install this downloaded deb package, also with dpkg. 
If you get again missing dependencies for this new package you have to repeat the apt-get download for the missing files / dependencies of the new package.

In some cases, the .deb package was not able to be installed since the corresponding 64bit version was at different version (usually higher since i have unstable repo in my sources list). 
As a result, it seems that the correct command to run if you have unstable repos, is 
#apt-get -t unstable download applicationname.
PS: It is though strange why simple apt-get doesn't get the package from unstable repos, since those repos are enabled in /etc/apt/sources.list

Some other times, installation of a 32bit lower version package was allowed, but this lead to errors in the installation chain process (next package complained about version missmatch of dependencies). 
You have to #dpkg --purge wrongversionofapplication and download and install the right version of the dependency package (i.e using -t unstable switch in apt-get)

During this purge and re-installation procedure i got some errors about wrong data files kept in the /etc/apt when trying to install the higher version. This was due to the fact that purging keeps the application folder together with a text file. I just deleted the text file created by previous version, and the new dpkg installation recreated this text file (and that proved to be OK for my system unless i have a broken system and i don't know it yet).

Using this apt-get download and dpkg -i method continuously i was capable finally to manually install (and run) teamviewer 11 and Kega Fusion.

PS: By the way teamviewer web page claims that there is a 64bit deb package for installation of teamviewer but this seems to be just a myth. 
When tried to install the "dedicated" 64bit teamviewer deb file, i also got errors about 32bit missing dependencies (WTF?)

PS: You install packages with dpkg by using the full package name with the .deb extension but for purging you have just to give the application name.
Install : #dpkg -i teamviewer_versionXXX_i386.deb


Remove: #dpkg --purge teamviewer (or teamviewer:i386)