How to Extract Debian Packages on Debian 12

Debian packages are used to install different software applications on Debian and Linux distributions derived from Debian such as Ubuntu. The debian packages contain the dependencies and configuration files of the software which are necessary for the installation of the software application. 

If the users want to look into the files of the Debian packages before installing them, they can do so by following the methods explained in this blog. This post will explain the easiest methods to extract the debian packages on Debian 12 with the following outline:

Let’s start with the understanding of the need to extract the debian packages. 

Why There is a Need to Extract Debian Packages?

The debian packages come with the extension of the deb in their names. When the debian packages are downloaded, the files of the debian packages can be extracted for the following reasons:

  • It helps the developers understand the programming script of the application
  • Users can install the application manually by extracting their debian packages
  • Users can update the dependency files inside the debian package by extracting it

After these reasons, follow one of the explained methods for extracting debian packages in the next section. 

What are the Ways to Extract Debian Packages on Debian 12?

Different ways can be used to extract the downloaded debian package of the software application. All these ways are explained in the complete guide separately. 

Method 1: Extract the Debian Package with the ar Command Utility

The first method to extract the debian package is by using the “ar” command which can be installed with the following command:

$ sudo apt install binutils -y

Note: In Debian 12, the package of “binutils” has been installed by default. 

When the “binutils” package is installed successfully, then navigate to the directory where the debian package is downloaded and run the command:

$ sudo ar vx VLC.deb

The debian package has been extracted successfully using the ar command utility and the extraction can be confirmed by listing down the contents:

$ ls

Method 2: Extract the Debian Package with the dpkg-deb Command Utility

Another method to extract the Debian package through the terminal is by using the “dpkg-deb” command. This command comes pre-installed on the Debian and can be used to extract the debian package:

$ sudo dpkg-deb -xv VLC.deb ./Documents/

Note: It is necessary to specify the target location where the extracted contents are supposed to be stored.

To list down the contents of the debian package before extracting it, use the “c” option of the dpkg-deb command:

$ sudo dpkg-deb -c VLC.deb

Method 3: Extract the Debian Packages Using the GUI Method

The most convenient method to extract the Debian packages is by using the graphical user interface. In this method, the default system archive manager is used in the following steps.

Step 1: Access the Debian Package

First, open the directory where the debian package is downloaded:

Step 2: Select the “Archive Manager” Option

Now right-click on the package file and a drop-down menu displayed, select “Open with Archive Manager” as shown:

Step 3: Extract the File

The contents of the debian package have been displayed, click on the “Extract” button to extract them:

Step 4: Choose the Destination

Finally, choose the destination to store the contents of the extracted debian package and click on “Extract” as shown:

The debian package has been extracted successfully using the GUI method. 

These are the different methods to extract the debian packages on Debian 12. 

Conclusion

To extract the debian packages, open the terminal, access the downloaded debian package, and use the “ar command” or “dpkg-deb command” to extract the debian packages. Another method to extract the debian packages is by using the default archive manager through the GUI method. 

All these three methods for extracting the debian packages have been explained in the complete guide in this blog.