Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to know how to install .deb packages without using a package manager such as dpkg. Is it possible to do this? What files do I have to edit? Or is there a unique procedure for each package?

share|improve this question
The disadvantage of doing this (not using a package manager) is that you will have to track down and install any dependencies manually and, depending on where you obtained the .deb, you could cause breakage (if you obtained a package from outside of the Ubuntu repositories). There is a nice, short discussion of the advantages of a package manager here It is written for fedora, but applies to any distro that uses a package manager. – bodhi.zazen Mar 7 '12 at 22:39
up vote 5 down vote accepted

You can unpack a .deb package using

ar x your_package.deb

Every .deb package contains the two files control.tar.gz and data.tar.gz.

data.tar.gz contains all the program's files.

control.tar.gz contains the metadata and some scripts: preinst is run by dpkg before unpacking data.tar.gz, postinst after unpacking. When removing a packge prerm is run before the program files are removed and postrm after that.

Quite likely this scripts don't work on a Non-Debian system but they may contain code you need to run to make the program work.

Why do you want to do this?

share|improve this answer
Thanks for the answer. As for why, it is partly out of curiosity, partly because I want to know how to manage packages if I find myself in a system with no GUI, no internet access, and dpkg popping up errors every time I try to use it. – InkBlend Mar 7 '12 at 22:51
I want to install Debian/Ubuntu on HP mini without CD ROM and have difficulties connecting to network due missing Broadcom wi-fi drivers. Few installation environments I tried do not have dpkg or other such tools and I had to manually unpack .deb file and run step-by-step tasks in preinst script. – ssasa Mar 1 '14 at 12:29

Why do you need to do this?

The .deb file contains files to be unpacked in specific locations in the filesystem, including configuration files, and some scripts to be executed before and after installation, upgrading and removal of the package. Failure to run the appropriate steps will result in a borked installation, which will be really hard to revert if the files are not under package manager control. Also, running the scripts may require some environment that's set up by the package manager and that may be quite difficult to replicate by hand.

That said, you can unpack a .deb file by hand:

ar x file.deb

this will leave three files: control.tar.gz, data.tar.gz and debian-binary. The two tarballs contain the control files, checksums and scripts (control.tar.gz) and the actual files to be unpacked on the filesystem (data.tar.gz). You may be able to get what you need by unpacking and analyzing these files.

Read more about the .deb package format here:

But to stress the point again, this is not really recommended and you stand a high chance of ending up with a borked install.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.