deb is a format and software packaging extension for the Linux distribution from Debian family and its derivatives. In this guide, we will explore how to extract a .deb package file. This is relevant to Software developers working on Debian related applications.

Debian applications are packaged as regular ar archives. A Debian package generally has three main files:

  • debian-binary: regular text file which stores the version of the deb package format.
  • control.tar.gz: This compressed file contains file md5sums and control directory for the deb package.
  • data.tar.xz: Contains all the installation files.

There are two common ways of unpacking a deb package.

Using ar command

You can also use the ar command with –x parameter. The ar command is provided by binutils package.

sudo apt -y install binutils tree
wget https://dev.mysql.com/get/mysql-apt-config_0.8.13-1_all.deb
ar -x mysql-apt-config_0.8.13-1_all.deb

If you want more verbose output, add the -v argument like this:

$ ar -xv mysql-apt-config_0.8.13-1_all.deb
x - debian-binary
x - control.tar.xz
x - data.tar.xz

Confirm:

$ tree
.
├── control.tar.xz
├── data.tar.xz
├── debian-binary
└── mysql-apt-config_0.8.13-1_all.deb

0 directories, 4 files

Using dpkg command

If you’re running a Debian based system. you can use dpkg command to extract a .deb package. Let’s consider an example.

wget https://dev.mysql.com/get/mysql-apt-config_0.8.13-1_all.deb
mkdir extrated
dpkg -x mysql-apt-config_0.8.13-1_all.deb extrated

There you have it. You have successfully extracted a deb package.

Top RHCSA / RHCE Certification Study Books

Best CCNP R&S Certification Preparation books

Best CEH Certification Preparation Books

Your support is our everlasting motivation,
that cup of coffee is what keeps us going!


As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.

LEAVE A REPLY

Please enter your comment!
Please enter your name here