First, install the rpm and yum tools

sudo apt-get install yum rpm

Create the chroot directory

mkdir -p /path/to/chroot

Initialize the rpm environment inside the chroot directory

rpm --root /path/to/chroot --initdb

Download the fedora-release*.rpm file that corresponds to the Fedora version you want to install and install it. Then, make sure you have all the Fedora GPG keys properly installed.

cd /path/to/chroot
rpm --root=$PWD -ivh fedora-release*.rpm
rpm --root=$PWD --import etc/pki/rpm-gpg/*
cp /etc/resolv.conf etc/
mount -o bind /dev dev
mount -o bind /dev/pts dev/pts
mount -o bind /dev/shm dev/shm
mount -o bind /proc proc
mount -o bind /sys sys

Finally, install some essentials using yum

yum --installroot=$PWD install bash yum
yum --installroot=$PWD install vim find ping wget ruby

To use the newly created chroot, have a look as schroot (available as a Debian package)

Last modified 7 years ago Last modified on 02/17/12 09:08:20