Debootstrapping and Chrooting

This article shows how to create a chroot environment. Why? –>

My initial use case was to set up Oracle Express - which only comes as a 32 bit package - on my 64 bit box:

|      jaunty amd64      |
|  +------------------+  |
|  |   jaunty i386    |  |
|  |  +------------+  |  |
|  |  |   oracle   |  |  |
|  |  +------------+  |  |
|  +------------------+  |

We will not create a bootable system! If you want that, see


Get debootstrap (what is wajig?):

wajig install debootstrap

Get admin rights to eliminate the need of typing sudo before every command:

sudo bash


Create target directory:

mkdir $target_dir

Choose a release, i.e. the release code name. See or


Choose a fast mirror (debian) for your release to increase debootstrap’s download speed:


Choose an architecture! It is important to choose the right architecture in the next step. You probably want i386 (aka. x86 aka. 32 bit) or amd64 (aka. 64 bit). For a full list of supported architectures see


And put it all together:

debootstrap --arch $arch $release $target_dir

This takes a while. Upon completion, have a look:

ls $target_dir

Mounting and Unmounting

Create and run the Bash script mountall:

cd /var/tmp  # or ~/bin if you like
cat > mountall << EOF
mount -t proc proc ${target_dir}/proc  # for bash completion
mount --bind /dev ${target_dir}/dev
mount -t sysfs sysfs ${target_dir}/sys

chmod +x mountall

Create the Bash script umountall for later use:

cat > umountall << EOF
umount ${target_dir}/proc
umount ${target_dir}/dev
umount ${target_dir}/sys

chmod +x umountall


chroot $target_dir

Done. Now you can install packages, run servers, ...

Upon exiting the chroot, remember to unmount:


After Reboot

Just mount everyhing and chroot:

chroot /usr/local/mychroot