In Debian and Ubuntu, you get software packaged in .deb file format.
Installing an application from the Deb file is similar to using MSI files in Windows.
You double-click on the deb file and it gets installed with the software center.
That's what most end users would do with the deb files.
However, if you are a developer or a tech-savvy advanced user, you may extract the deb file to see some information before you install the package from it.
The extracted version of the deb file will contain nothing but multiple files such as the control archive (info about package name, dependencies, version, etc.), scripts, data archives, conf files, documentation, and other files.
Most users would never need this. Still, I will walk you through multiple ways to extract a deb file in Ubuntu Linux.
Extract deb files in Ubuntu
In this tutorial, I will walk you through two different ways to extract deb files in Ubuntu or any other Linux distribution:
- Using system archive manager (easy)
- Using the dpkg-deb command
Let's start with the easy one.
1. Extract deb files using the system archive manager
This is the easiest way to extract files in Linux as all it takes is a couple of clicks and your file will be extracted at the desired location. No terminal is required!
To extract files using this method, you have to follow the given steps:
- Right-click on the deb file and select Open With Archive Manager option.
- It will show the contents of the archive, Simply press the
Extract
button. - From the file manager choose where you want to extract the file and click on the
Extract
button.
Once done, you will the deb file is extracted at the selected location:
But as you can see, there are more tar files (another form of compressed file), and if you want to learn how to untar files then here's the detailed guide:
2. Extract deb files using the dpkg-deb command
The main benefit of using this method is unlike earlier, it won't leave any tar files behind and the output will be ready to use without extra steps.
To use the dpkg-deb command, you have to follow the given command syntax:
dpkg-deb -R /path/to/target.deb /path/to/extact
For example, here, I extracted a discord deb file to the test directory:
As you can see, when I used the ls command, it showed no tar files further, making it a ready-to-go choice for advanced users.
Here's how you deal with other archive files
If you have files with different types of compression applied to it, here's how you deal with the most of them:
Learn how to unzip files in Ubuntu:
Here's how you extract tar.xz
files in Linux:
And if you want to learn using the tar command itself to create, extract and modify the existing tar files then here you go:
I hope you will find this guide helpful.