From ::
Http://www.g-loaded.eu/2008/01/28/how-to-extract-rpm-or-deb-packages/
Rpm and Deb packages are both containers for other files. An rpm is some sortCpioArchive. On the other hand, a deb file is a pure
ArArchive. so, it shoshould be possible to unpack their contents using standard archiving tools, regardless of your distribution's package format. under normal conditions, you should use your distribution's standard package manager,
RpmOrDpkgAnd their frontends, to manage those files. But, if you need to be more generic, here is how to do it.
Rpm
For RPMs you need two command line utilities,Rpm2cpioAnd
Cpio. Extracting the contents of the RPM package isOne stepProcess:
Rpm2cpio mypackage. RPM | cpio-vid
If you just need to list the contents of the package without extracting them, use the following:
Rpm2cpio mypackage. RPM | cpio-vt
The-VOption is used in order to get verbose output to the stdout. If you don't need it, you can safely omit this switch. For more information aboutCpio
Options,
Please refer toCpio (1)
Manual page.
Deb
Deb files areAr Archives, Which contain three files:
- Debian-binary
- Control.tar.gz
- Data.tar.gz
As you might have already guessed, the needed archived files exist inData.tar.gz
. It is also obvious that unpacking this file is
Two-stepProcess.
First, extract the aforementioned three files from the Deb file (ArArchive ):
Ar VX mypackage. Deb
Then extract the contentsData.tar.gz
Using
Tar:
Tar-xzvf data.tar.gz
Or, if you just need to getListingOf the files:
Tar-tzvf data.tar.gz
Again-VOption in bothArAnd
TarIs used in order to get verbose output. It is safe not to use it. For more information, read the man pages:Tar (1)
And
AR (1)
.
If anyone knowsOne Step ProcessTo extract the contents of
Data.tar.gz
, I 'd be very interested in it!
Update
As Jon
Suggested in the comment area, the contents of data.tar.gz can be extracted from the Deb package in a one step process as shown below:
Ar P mypackage. Deb data.tar.gz | tar ZX
That will do it.