January 16, 2004
Extracting files from an RPM archive
Should anyone else need it, the command to extract files out of an RPM file is: rpm2cpio RPM_file | cpio -idv
This will dump the contents into subdirectories within the current directory. That is, you might want to make sure you're in a place that's good for holding these files (as in, not in the / root). I've done it with for stuff like this:
cd /tmpThis resulted in downloading the RH9 version of modutils and then extracting it into subdirectories within /tmp/oldmodutils. I could them snag a copy of modprobe for use with the 2.6 kernel generate-modprobe-conf tool. A quick cp /tmp/oldmodutils/sbin/modprobe /sbin/modprobe.old took care of copying the needed program from the old version for the new kernel's tools.
mkdir oldmodutils; cd oldmodutils
wget ftp://194.199.20.114/linux/redhat/9/en/os/i386/RedHat/RPMS/modutils-2.4.22-8.i386.rpm
rpm2cpio modutils-2.4.22-8.i386.rpm | cpio -idv
ls -r
Hope this helps someone.







