Extract a single file from a RPM package

How to extract single file from RPM package

Use the following command:

rpm2cpio {fullpackagename} | cpio -idv {FullnameOfFileToGet}

Sample Output:

> rpm2cpio  xmlto-0.0.18-0.i586.rpm | cpio -idv  ./usr/share/xmlto/format/fo/dvi
./usr/share/xmlto/format/fo/dvi
100 blocks
How to extract all files from RPM package

Use the following command:

rpm2cpio {fullpackagename} | cpio -idv

Sample Output:

> rpm2cpio  xmlto-0.0.18-0.i586.rpm | cpio -idv
./usr/bin/xmlif
./usr/bin/xmlto
./usr/share/man/man1/xmlif.1.gz
./usr/share/man/man1/xmlto.1.gz
./usr/share/xmlto
./usr/share/xmlto/format
./usr/share/xmlto/format/docbook
./usr/share/xmlto/format/docbook/dvi
./usr/share/xmlto/format/docbook/fo
./usr/share/xmlto/format/fo/dvi
100 blocks
Back to GNU/Linux Application Tips