HOWTO - Resolve 32-Bit Dependencies on 64-Bit Ubuntu or Debian with getlibs

One of the more irritating aspects of running a 64-bit distribution is that there are still a large number of applications that are not compiled as native 64-bit binaries. This leads to dependence on 32-bit libraries, and managing these 32-bit dependencies can be a nightmare. There is no shortage of users who have introduced more problems than they have solved by forcing the installation of 32-bit libraries.
Cappy has released a handy script to detect and install libraries and other dependencies for 32-bit applications on 64-bit Ubuntu GNU/Linux. Handy things it can do include fetching missing libraries either by name, and figuring out which ones are needed when presented with a given binary.
Note: This script makes use of the Debian package management system, and is unlikely to function properly on distributions that are not Debian-based.
Installing getlibs
Installation couldn't be simpler. Download getlibs, and double-click the .deb package. If you download getlibs via Firefox, you should get an 'Open with gdebi' option or something equivalent. To install via commandline, try:
$ wget http://www.boundlesssupremacy.com/Cappy/getlibs/getlibs-all.deb
$ sudo dpkg -i getlibs-all.deb
Installing Libraries with gelibs
Usage is pretty straightforward. If you know the name of the library you need, you can feed it to getlibs, and it should fetch it.
$ sudo getlibs -l libogg.so.0 libSDL-1.2.so.0
Matched library libogg.so.0 to libogg0
Matched library libSDL-1.2.so.0 to libsdl1.2debian-all
Reading package lists... Done
Building dependency tree
Reading state information... Done
libogg0 is already the newest version.
The following NEW packages will be installed:
libsdl1.2debian-all
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 213kB of archives.
After unpacking 20.5kB of additional disk space will be used.
Do you want to continue [Y/n]?
Alternatively, provide getlibs with the location of a given binary, and it should figure out what is missing (if anything) and install it. For example, say the binary for Second Life was located at /opt/32/secondlife/secondlife.bin:
$ sudo getlibs /opt/32/secondlife/secondlife.bin
At which point it should match any libraries that are not currently installed and fetch them, assuming they are available (see above for output example).
Sources
