PDF Hacks

PDF Hacks

One line code to extract DEB packages

ar p mypackage.deb data.tar.gz | tar zx

DEB files are ar archives, which contain three files:

  • debian-binary
  • control.tar.gz
  • data.tar.gz

As you might have already guessed, the needed archived files exist in data.tar.gz. It is also obvious that unpacking this file is a two-step process.

First, extract the aforementioned three files from the DEB file (ar archive):

ar vx mypackage.deb

Then extract the contents of data.tar.gz using tar:

tar -xzvf data.tar.gz

Or, if you just need to get a listing of the files:

tar -tzvf data.tar.gz

Again the -v option in both ar and tar is 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).

Source: http://www.g-loaded.eu/2008/01/28/how-to-extract-rpm-or-deb-packages/

August 18, 2009 Posted by | Hacks | , | 1 Comment