Using the official CD from Debian or Ubuntu to install a fresh new system can be tedious if you just want a minimal or customized system. An alternative way to install Debian or Ubuntu is to use cdebootstrap. cdebootstrap is a simple command-line program that downloads packages from a Debian/Ubuntu archive, unpacks them into a mounted filesystem, and set 'em up. But it's not a full-fledged installer, so you need to take care of partitioning and setting up bootloader in order to complete the installation.
In order to use cdebootstrap, you need to have an already-running Linux system. However, any Linux live CD will suffice. Fortunately, I have created my own Debian Live CD with included cdebootstrap. I booted my Debian Live and opened mlterm.
If you don't have cdebootstrap, there are many ways to install it. Download a cdebootstrap-static package from http://packages.debian.org/sid/cdebootstrap-static that matches your architecture. If you are running an rpm-based system, such as Fedora, use ar, tar and gzip to unpack the package. For example:
ar xv cdebootstrap-static_0.5.5_i386.deb
gzip -dc data.tar.gz > /tmp/data.tar
cd /; tar xvf /tmp/data.tar
Before running cdebootstrap, make sure that you have an empty partition and have mounted it. GParted can be used to create an empty partition. In the following example, I used cdebootstrap-static to install Ubuntu 6.06 Dapper into a filesystem mounted on /mnt.
cdebootstrap-static --allow-unauthenticated --flavour=minimal dapper /mnt http://archive.ubuntu.com/ubuntu
--allow-unauthenticated option is used in case ubuntu-archive-keyring or debian-archive-keyring is not installed. There are three flavours to choose from: minimal, standard and build. For suites other than dapper, you can choose one among etch, lenny, squeeze, sid, breezy, dapper, edgy, feisty, gutsy, hardy, intrepid, oldstable, stable, testing, unstable.. The URL at the end of command line is optional. For Debian, you can type
cdebootstrap downloaded and installed the following set of packages into the new filesystem mounted at /mnt. This list is for a minimal flavour.
apt base-files base-passwd bash belocs-locales-bin bsdutils coreutils debconf debconf-i18n debianutils diff dpkg e2fslibs e2fsprogs findutils gcc-4.0-base gnupg grep gzip hostname initscripts libacl1 libattr1 libblkid1 libbz2-1.0 libc6 libcap1 libcomerr2 libdb4.3 libgcc1 libgcrypt11 libgnutls12 libgpg-error0 libldap2 liblocale-gettext-perl liblzo1 libncurses5 libopencdk8 libpam-foreground libpam-modules libpam-runtime libpam0g libreadline5 libsasl2 libsasl2-modules libselinux1 libsepol1 libslang2 libss2 libssl0.9.8 libstdc++6 libtasn1-2 libtext-charwidth-perl libtext-iconv-perl libtext-wrapi18n-perl libusb-0.1-4 libuuid1 locales login lsb-base makedev mawk mount ncurses-base ncurses-bin perl-base python-minimal python2.4-minimal readline-common sed sysv-rc sysvinit tar ubuntu-keyring util-linux zlib1g
In order to fine-tune the newly installed system, chroot into it and install additional packages.
chroot /mnt /bin/bash