How to extract deb package


#1

Debian packages are regular ar archives. They contains three files:

  • debian-binary: regular text file, contains the version of the deb package format
  • control.tar.gz: compressed file, contains file md5sums and control directory for the deb package
  • data.tar.xz: compressed file, contains all the files which will be installed

To unpack a .deb archive you can use following ar command with x parameter or if you want more verbose output, xv parameter as below:

$ ar x example.deb
$ ar -xv example.deb
x - debian-binary
x - control.tar.gz
x - data.tar.xz

If you are using a Debian based distribution or you have dpkg installed, you can also use dpkg to extract/unpack deb package without installing in your system:

$ dpkg -x package.deb /tmp/out

You have to provide directory for unpack at the last parameter of the command.

When command finished, you will see the deb package contents in /tmp/out directory.