How to debootstrap on CentOS Linux

debootstrap is Debian GNU/Linux bootstrapper which allows you to install Debian base systems such as Debian or Ubuntu into a directory of your currently running system. This config is a getting started guide on how to debbootstrap on CentOS/RHEL. The debootstrap package is not available in a standard CentOS repository. To make it available we first need to enable EPEL repository. Download EPEL repository package:

# wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

and install it using RPM command:

# rpm -Uvh epel-release-7-5.noarch.rpm

The EPEL repository should now be enabled. To confirm run:

# yum repolist | grep epel                                                                                  
 * epel: epel.mirror.digitalpacific.com.au

Now, we simply install debootstrap using yum:

# yum install debootstrap.noarch

All should be ready for bootstrapping. To find out what debootstrap scripts are available run:

# ls /usr/share/debootstrap/scripts/
breezy  etch-m68k  hoary         jessie  maverick   potato   sarge             sid      testing   vivid         woody
dapper  feisty     hoary.buildd  karmic  natty      precise  sarge.buildd      squeeze  trusty    warty         woody.buildd
edgy    gutsy      intrepid      lenny   oldstable  quantal  sarge.fakechroot  stable   unstable  warty.buildd
etch    hardy      jaunty        lucid   oneiric    raring   saucy             stretch  utopic    wheezy

At this stage we know what release we want. We also need to create destination directory, choose architecture and mirror. The following linux command will install
Ubuntu Trusty Tahr amd64 release into chroot directory using http://mirror.internode.on.net/pub/ubuntu/ubuntu/ as mirror:

# mkdir chroot
# debootstrap --arch=amd64 trusty chroot http://mirror.internode.on.net/pub/ubuntu/ubuntu/

In case you see error:

E: No pkgdetails available; either install perl, or build pkgdetails.c from the base-installer source package 

Fix it by installation of perl package:

# yum install perl