Download Ubuntu debootstrap:
http://archive.ubuntu.com/ubuntu/pool/main/d/debootstrap/debootstrap_1.0.9~hardy1_all.deb
Install Ubuntu debootstrap:
sudo dpkg -i debootstrap_1.0.9~hardy1_all.deb
Download Ubuntu rootfs using debootstrap:
sudo debootstrap –variant=buildd –arch i386 hardy /var/chroot/hardy http://archive.ubuntu.com/ubuntu/
Copy the sources.list:
sudo editor /var/chroot/hardy/etc/apt/sources.list # copy and paste the text below
# ——— START HERE
#
# deb cdrom:[Ubuntu 8.04 _Hardy Heron_ - Release i386 (20080422.2)]/ hardy main restricted
#deb cdrom:[Ubuntu 8.04 _Hardy Heron_ - Release i386 (20080422.2)]/ hardy main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://br.archive.ubuntu.com/ubuntu/ hardy main restricted
deb-src http://br.archive.ubuntu.com/ubuntu/ hardy main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://br.archive.ubuntu.com/ubuntu/ hardy-updates main restricted
deb-src http://br.archive.ubuntu.com/ubuntu/ hardy-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://br.archive.ubuntu.com/ubuntu/ hardy universe
deb-src http://br.archive.ubuntu.com/ubuntu/ hardy universe
deb http://br.archive.ubuntu.com/ubuntu/ hardy-updates universe
deb-src http://br.archive.ubuntu.com/ubuntu/ hardy-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://br.archive.ubuntu.com/ubuntu/ hardy multiverse
deb-src http://br.archive.ubuntu.com/ubuntu/ hardy multiverse
deb http://br.archive.ubuntu.com/ubuntu/ hardy-updates multiverse
deb-src http://br.archive.ubuntu.com/ubuntu/ hardy-updates multiverse
## Uncomment the following two lines to add software from the ‘backports’
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://br.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse
# deb-src http://br.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical’s
## ‘partner’ repository. This software is not part of Ubuntu, but is
## offered by Canonical and the respective vendors as a service to Ubuntu
## users.
# deb http://archive.canonical.com/ubuntu hardy partner
# deb-src http://archive.canonical.com/ubuntu hardy partner
deb http://security.ubuntu.com/ubuntu hardy-security main restricted
deb-src http://security.ubuntu.com/ubuntu hardy-security main restricted
deb http://security.ubuntu.com/ubuntu hardy-security universe
deb-src http://security.ubuntu.com/ubuntu hardy-security universe
deb http://security.ubuntu.com/ubuntu hardy-security multiverse
deb-src http://security.ubuntu.com/ubuntu hardy-security multiverse
# ——— FINISH HERE
Define DNS server :
sudo cp /etc/resolv.conf /var/chroot/hardy/etc/resolv.conf
Chrooting to your ubuntu:
sudo chroot /var/chroot/hardy
Update and some configurations:
apt-get update
apt-get install wget debconf devscripts gnupg nano #For package-building
apt-get update #clean the gpg error message
apt-get install locales dialog #If you don’t talk en_US
locale-gen en_GB.UTF-8 # or your preferred locale
tzselect; TZ=’Continent/Country’; export TZ #Configure and use our local time instead of UTC; save in .profile
exit
echo “export LANG=C” >> ~/.bashrc # if you don’t want locale warnings
Reinstall Debia debootstrap:
sudo apt-get install –reinstall debootstrap
reference: https://wiki.ubuntu.com/DebootstrapChroot