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 update
sudo apt install binutils tree -y
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
Confirm directory contents:
$ tree extrated/
extrated/
āāā usr
āāā share
āāā doc
āāā mysql-apt-config
āāā COPYING.gz
āāā README
āāā changelog.Debian.gz
āāā copyright
4 directories, 4 files
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