Installing Simple Applications

Installing Simple Applications
Simple applications can be installed without having root access and without compiling. The trick is to get the Debian .deb file, extract the package into your own pseudo-root. To invoke the application you simple invoke the binary with LD_LIBRARY_PATH set so the application can use the libraries you have installed. This only works if the postinst and preinst scripts in the deb file don't do anything if real import or if you do the commands manually.

This is a pretty tedious process if your application requires lots of complex packages. I used this process to install abiword in my home directory (don't ask why :-. It took me about an hour to build up the list of deb files to install.

This entry is here just in case someone else needs to install a relatively simple application too, as I am sure not one would want to install abiword also. :-)

The following is a script of the commands I used and is of no interest to others except to server as an example of the steps necessary.

#!/bin/bash # #   This is used to create a non-root installation of abiword #  The scheme is to get all the necessary debs, then extract #  the files into my own pseudo-root and invoke abiword #  from usr/bin with LD_LIBRARY_PATH set to the usr/lib. # #   For simple apps this might work as long as all of the #  files of interest are in the pseudo root directories #  and the application can figure out how to find this (by  #   a relative root to the path of the binary, for instance). # #   This works also because the preinst and postinst scripts #  in the deb files is either done manually or is not necessary. #  For instance some debs invoke something to put the binary #  in the menu for the window manager. That really is not needed #  for any application. # #   The difficult part of all this is to get a list of the deb files #  to be downloaded. First you must get a list of all the dependencies #  from the web site, or perhaps with 'apt-rdepends'. #  Once you have the dependency list, then check if the package #  is already installed (most will be) using 'dpkg -l | grep NAME' #  Once you have a list of the packages to install, you need to  #   determine the path to the pool where the *.deb file is installed #  (the file 'Packages.gz' for the repository is a good source). # #   This script is really just a simple series of wget commands #  and 'dpkg -x' commands. One could probably generate the list of *.deb #  filenames in a separate input file and then write a script to  #   find the pool name and go from there. # #   Surely there's a better way to do this, but I was unable to find it. #  dpkg has options --root-dir and --force-not-root which seemed #  like they should help, but both failed as they require root. # h="wget http://mirror.newdream.net/debian" root=~/root #  We must start in the directory where debs are saved mkdir -p ~/debs cd ~/debs || exit 1 #  Dependencies not on system $h/pool/main/a/abiword/abiword_2.8.2-2.1_amd64.deb $h/pool/main/a/abiword/abiword-common_2.8.2-2.1_all.deb $h/pool/main/a/abiword/libabiword-2.8_2.8.2-2.1_amd64.deb $h/pool/main/a//aiksaurus/libaiksaurusgtk-1.2-0c2a_1.2.1+dev-0.12-6_amd64.deb #  dep libgoffice-0.8* $h/pool/main/g/goffice/libgoffice-0.8-8_0.8.8-1_amd64.deb $h/pool/main/g/goffice/libgoffice-0.8-8-common_0.8.8-1_all.deb #  dep: libloudmouth1-0 (>= 1.1.4-2) $h/pool/main/l/loudmouth/libloudmouth1-0_1.4.3-7_amd64.deb #  dep: libasyncns0 $h/pool/main/liba/libasyncns/libasyncns0_0.3-1.1_amd64.deb #  dep: libots0 $h/pool/main/o/ots/libots0_0.5.0-2_amd64.deb #  dep: libsoup2.4-1 (>= 2.4.0) $h/pool/main/libs/libsoup2.4/libsoup2.4-1_2.30.2-1+squeeze1_amd64.deb #  dep: libwpd8c2a $h/pool/main/libw/libwpd/libwpd8c2a_0.8.14-1_amd64.deb #  dep: libwpg-0.1-1 $h/pool/main/libw/libwpg/libwpg-0.1-1_0.1.3-1_amd64.deb #  dep: libwps-0.1-1 $h/pool/main/libw/libwps/libwps-0.1-1_0.1.2-1_amd64.deb #  These were not identified as dep #  dep: libenchant1c2a $h/pool/main/e/enchant/libenchant1c2a_1.6.0-1_amd64.deb #  Now install everything in $root mkdir -p $root for d in *.deb; do   echo "Installing $d" dpkg -x $d $root done echo "To use these you'll probably need to do:" echo " export LD_LIBRARY_PATH $root/usr/lib" echo "and maybe" echo " export PATH $root/usr/bin:$PATH"