How to extract .rpm package?

There is no direct RPM option available via rpm command to extract an RPM file. But there is a small nifty utility available called rpm2cpio. It Extract cpio archive from RPM Package Manager (RPM) package. With the following hack you will be able to extract an RPM file.

So rpm2cpio converts the .rpm file specified as a single argument to a cpio archive on standard out. If a – argument is given, an rpm stream is read from standard in.

$rpm2cpio filename.rpm | cpio -idmv

Output of rpm2cpio piped to cpio command (see how to use cpio) 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
Advertisements

About Priyanka Kapoor

Simple, Hardworking & friendly.....
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s