How to extract an RPM package without installing it

Linux specific questions/information are gathered here. The main thrust of topics are applied to Centos/RedHat(RH)/Debian/Ubuntu/Gentoo distributives

How to extract an RPM package without installing it

Postby lik » Fri Apr 09, 2010 6:58 am

As the name implies, rpm2cpio takes an RPM package file and converts it to a cpio archive. Because it's written to be used primarily as a filter, there's not much to be specified. rpm2cpio takes only only one argument.

Code: Select all
rpm2cpio php-pdo-5.1.6-24.el5_4.5.i386.rpm| cpio -idmv

202 blocks

Output of rpm2cpio piped to cpio command with following options:
i: Restore archive
d: Create leading directories where needed
m: Retain previous file modification times when creating files
v: Verbose i.e. display progress

Verify that you have extracted an RPM file in current directory:
Code: Select all

etc php-pdo-5.1.6-24.el5_4.5.i386.rpm usr
Posts: 497
Joined: Wed Dec 15, 2010 3:21 am

Return to Linux specific


  • Related topics
    Last post