Yea, most people do not know aboutusing rpm from the rescue mode......... perhaps a down and dirty recovery guide is in order.
After booting into rescue mode but before using the chroot command the excutable version of rpm needs to be 'pulled' from the media first so one can use it to re-install the rpm packages.
So lets start by creating a location for the rpm files and rpm itself;
mkdir /mnt/sysimage/root/RPM_restore
Then copy rpm from the media;
cp /mnt/runtime/usr/bin/rpm /mnt/sysimage/root/RPM_restore/rpm
Now use the chroot command;
chroot /mnt/sysimage
The next step is to copy the rpm packages from the CD to someplace to re-install them;
mount /mnt/cdrom (or whichever is the mountpoint for the CD/DVD drive)
ls -l /mnt/cdrom/Fedora/RPMS/rpm* (to get the list of the packages to copy)
Copy each of the packages listed from the output to where the 'pulled' rpm is located, for example;
Code:
cp /mnt/cdrom/Fedora/RPMS/rpm-4.3.2-21.i386.rpm /root/RPM_restore/rpm-4.3.2-21.i386.rpm
Repeat until all files are copied. One may find it a bit easier to reboot the system normally and then copy or install the rpm packages from the CD/DVD. In either case once all the rpm packages are in the same location install them all at once, for example;
rpm -ivh rpm*.rpm
/root/RPM_restore/rpm -ivh /mnt/cdrom/Fedora/RPMS/rpm*.rpm
Sample results(using the force switch since I do not need to re-install them);
Code:
# /root/RPM_recover/rpm -ivh /root/RPM_recover/rpm*.rpm --force
Preparing... ########################################### [100%]
1:rpm-libs ########################################### [ 17%]
2:rpm ########################################### [ 33%]
3:rpm-build ########################################### [ 50%]
4:rpmdb-CentOS ########################################### [ 67%]
5:rpm-devel ########################################### [ 83%]
6:rpm-python ########################################### [100%]
hth