If you want a real minimal Debian system (don't know if this works with Ubuntu) do the following (in this example for Squeeze 32 bit):
1. Start your system from a Debian live-CD.
2. Mount your /-partition, for example:
Code:
mount /dev/sda1 /mnt
3. Install a minimal system to this partition with
debootstrap:
Code:
debootstrap --variant=minbase squeeze /mnt
This will install only the really essential packages and apt (Note: apt is not essential, because you can install packages with dpkg).
4. Copy over your network settings (I think you need at least the /etc/resolv.conf) to /mnt/etc and chroot into the new system:
Code:
cp /etc/resolv.conf /mnt/etc/
chroot /mnt
5. Now install the packages needed for the system to start, like a kernel and a bootloader:
Code:
apt-get install linux-image-2.6-686 grub-pc
6. Now you need to configure your new system, at least the /etc/fstab. For this we should install a text-editor. While doing this we can also install the other software you need, like aptitude:
Code:
apt-get install vim aptitude
7. Now configure the system to your likings. Don't forget to set a password for root before rebooting.
This way you will get the smallest possible Debian system.
EDIT:I forgot about that, you will have to write a /etc/apt/sources.list file in your new system before you can install anything on it. I also would recommend to have a /etc/apt/apt.conf with this content:
Code:
APT::Install-Recommends "0";
APT::Install-Suggests "0";
This way apt-get/aptitude will not pull in recommended or suggested packages when installing software, but only really needed dependencies.