- yum package is not installed
- rpm database are not located at /var/lib/rpm
- rpm under /home/$USER/.rpmdb may not compatible with your Fedora RPM version
#!/bin/sh
#
# Fedora Release
DISTRO=fedora
RELEASE=9
ARCH=i386
FOLDER=${DISTRO}-${RELEASE}
BOOTSTRAP_PATH=${PWD}/${FOLDER}
MIRROR=`curl -s "http://mirrors.fedoraproject.org/mirrorlist?repo=${DISTRO}-${RELEASE}&arch=i386" | grep http[\:] | head -1`
echo 'Mirror from Fedora Project ' ${MIRROR}
febootstrap --noclean --install="fedora-release" --install="yum" ${RELEASE} ${BOOTSTRAP_PATH} ${MIRROR}
cp /etc/resolv.conf ${FOLDER}/etc/
mount -t proc none ${FOLDER}/proc
cd ${FOLDER}
RPM_PKG=`find var -type f | grep rpm-[0-9] | grep rpm$`
FEDORA_PKG=`find var -type f | grep fedora-release-[0-9] | grep rpm$`
cd ..
chroot ${BOOTSTRAP_PATH} /bin/rpm --initdb
chroot ${BOOTSTRAP_PATH} /bin/rpm -ivh --nodeps ${RPM_PKG}
chroot ${BOOTSTRAP_PATH} /bin/rpm -ivh --nodeps ${FEDORA_PKG}
chroot ${BOOTSTRAP_PATH} yum -y check-update
chroot ${BOOTSTRAP_PATH} yum -y install yum rpm fedora-release
chroot ${BOOTSTRAP_PATH} yum -y update
chroot ${BOOTSTRAP_PATH} yum -y groupinstall core buildsys-build
# you can simply duplicate the previous line to install more packages automatically
chroot ${BOOTSTRAP_PATH} yum clean all
umount ${FOLDER}/proc
You can simply copy & paste into a bootstrap.sh. Please modify the shell script. Edit RELEASE and ARCH to suit your needs.
Before running this script, please install the packages at your Ubuntu 10.10 environment.
apt-get install yum rpm curl febootstrapHappy Hacking!