Larry Ewing's Penguin Two Penguins Larry Ewing's Penguin

How to unpack an RPM without installing it

As long as you have the rpm and cpio packages installed on your system, you can do these steps.

Step One View the files in the RPM

$ rpm2cpio filename.rpm | cpio -t

Step Two Extract the files in the RPM

$ mkdir /tmp/somedir
$ cd /tmp/somedir
$ rpm2cpio filename.rpm | cpio -id

This extracts files into the actual paths they would be installed to on the system, but under your current directory, e.g. /tmp/somedir/usr/share/emacs. When you're done, clean up after yourself:

$ cd - $ rm -rf /tmp/somedir

Back to Linux Tips

Last modified: June 3, 2009, 12:33pm

Valid HTML 4.01!

solvency amendment