How to Extract Deb Files

Want to see what a deb package consists of? Learn to extract a deb file in Ubuntu.
Warp Terminal

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.

3 Ways to Install Deb Files on Ubuntu & Remove Them Later
This beginner article explains how to install deb packages on Ubuntu. It also shows you how to remove those deb packages afterward.

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.

πŸ“‹
Extracting a deb file is different from running a deb file. If you want to install an application from deb file, you run it by double clicking on it. Extracting to see its content is different from installation.

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.
Extract deb files using the system archive manager

Once done, you will the deb file is extracted at the selected location:

extract deb files in Linux

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:

Untar Files in Ubuntu
Learn to extract various kinds of tar files in Ubuntu command line.

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:

How to Unzip Files in Ubuntu & Other Linux [Terminal & GUI]
This quick tip shows you how to unzip a file in Ubuntu and other Linux distributions. Both terminal and GUI methods have been discussed.

Here's how you extract tar.xz files in Linux:

How to Extract or Unzip tar.xz File in Linux
Learn how to unzip tar.xz file in Linux terminal. Also learn what are tar and xz files.

And if you want to learn using the tar command itself to create, extract and modify the existing tar files then here you go:

How to Create and Extract Tarballs in Linux Command Line
Tar is one of the most common tool used for archiving files in Linux. Learn how to create a tarball and how to extract it in the beginner’s tutorial.

I hope you will find this guide helpful.

About the author
Sagar Sharma

Sagar Sharma

A software engineer who loves to write about his experience with Linux. While reviving my crashed system, you can find me reading literature, manga, or watering my plants.

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

itsfoss happy penguin

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.