...making Linux just a little more fun!
Kapil Hari Paranjape [kapil at imsc.res.in]
Hello,
Here is a short write-up on a neat trick that I came across yesterday. I would like some feedback on whether it works for others before I try to turn it into an article.
Regards,
Kapil.
--==================Using fakechroot================================ "Testing testing or breaking toys"the "latesht" software out there. Sometimes this is necessiated by the hardware being "latesht" as well, but more often then not it is out of a fear of being labelled "obsolete". Here is one way to use newer software if any of the following applies to you: 1. You do not have root access. 2. You do not want your changes to tamper with system files. 3. You want to ensure that you can recover your system exactly as it was before --- just in case. 4. You are too busy^Wlazy to compile everything for yourself. 5. You want software to run at "real" speeds, not slow^Wemulator speeds. The following conditions apply to the solution presented: A. The software you want has been packaged for your hardware. B. You are not afraid that this software will damage files owned by you (as user). Alternatively, you do have root access to create a different user to run this software as. C. The software you want to use/test is not something "core" like the "kernel" and does not depend on a new feature of the kernel. D. You are using Debian or a derivative. (Similar solutions are available for Fedora etc. but I haven't worked them out) C. You have enough disk space (at least 1GB or so depending on the size of the package you want). By hook or by crook, you need to ensure that your system has the following (rather small) packages installed: fakeroot, fakechroot, debootstrap. In the following, I will assume that the software you want to use is "iceweasel" with the "gcjwebplugin" from the "sid" distribution because that is what I needed! Step 0: Decide on some locations: TOP=$HOME/testing2 STATE=$TOP/files.state ROOT=$TOP/testing mkdir $TOP Step 1: Install the system. PATH=/sbin:/usr/sbin:/bin:/usr/bin; export PATH fakeroot -s $STATE fakechroot \ debootstrap --variant=fakechroot lenny $ROOT Step 2: Perform some fixes inside $ROOT myid=$UID fakeroot -i $STATE -s $STATE fakechroot chroot $ROOT /bin/bash This will give you a "root" prompt which is not "real". We first setup to install some packages from sid. echo deb http://your.debian.mirror/debian testing main > /etc/apt/sources.list echo deb http://your.debian.mirror/debian unstable main >> /etc/apt/sources.list echo 'APT::Default-Release "testing";' >> /etc/apt/apt.conf Install the packages we want. apt-get -y install iceweasel gcjwebplugin Create a user account to use these packages. adduser --uid=$myid $LOGNAME Exit from this prompt exit Back at the original prompt. We need to give X access to the sub-user. rm $ROOT/tmp/.X11-unix ln -s /tmp/.X11-unix $ROOT/tmp/ ln -s $HOME/.Xauthority $ROOT/$HOME/ Step 3: Use the program! fakechroot chroot $ROOT iceweasel Step 4: Update your software (required as soon as you hear of exploits!) fakeroot -i $STATE -s $STATE fakechroot chroot $ROOT /bin/bash apt-get update apt-get upgrade exit ==================End of instructions=============================