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'm in the process of building a debian package. The goal is to package up a directory into a .deb that will have 2 dependencies that are other packages I created.

When installing the .deb package, I see the errors regarding missing dependencies which is great, but it still dumps the directory and contents even though it's missing dependencies.

My question is if this is appropriate behavior? I do not want the directory created and populated if there are missing dependencies. Any help would be appreciated!



dpkg -i hdf5.deb
Selecting previously unselected package hdf5.
(Reading database ... 305222 files and directories currently installed.)
Unpacking hdf5 (from hdf5.deb) ...
dpkg: dependency problems prevent configuration of hdf5:
 hdf5 depends on szip (>= 2.9); however:
  Package szip is not installed.

dpkg: error processing hdf5 (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
share|improve this question
If the dependencies of a package are not satisfied that package is not going to get installed unless you force the package manager to do so. Could you please add the command you run and the full error messages you get to your question? – Florian Diesch Feb 21 '13 at 20:12
Package was built using dpkg-deb --build and successfully created a .deb package. Output in original post. So it can see the dependency, but still creates/populates the dir. – hito Feb 21 '13 at 20:19
up vote 0 down vote accepted

Your problem is that you're installing a package you built, which has dependencies which you haven't yet installed, using dpkg. While dpkg will install package, it does not resolve dependencies and install missing packages for you. You'll need to install them with apt to pull from archives, or if you have a .deb of the package you need, you'll need to install it first, or at the same time as your new package, using dpkg.

What you are describing is a Depends which the resulting binary package has, not a Build-Depends which the source package would need to build. Placing all of the binary package runtime dependencies inside the Build-Depends in your control file, is a good way to prevent building a package without them installed. It's also good practice to enumerate all of the dependencies you have, rather than relying on dependencies being satisfied by other packages you depend on requiring them as well, to prevent breaking if the dependency gets dropped from the other package you also need.

share|improve this answer
Dobey, I appreciate your input. I guess to simplify things I'll explain the intent. I have a directory that holds library files and scripts that I would like to package up. There are 3 total packages I would like to create, 1 of which depends on the other 2. Now, I do not want my main package to "install" (by this, I mean literally just put files in the appropriate place) if dependencies are not met. In my case, I see the warning as above, but the directory still gets populated. I hope I'm explaining myself decently here. Also note I am novice in skill level regarding this. Thank you! – hito Feb 21 '13 at 21:28
Yes. dpkg will unpack the package, but fail to configure it, if the dependencies are missing. apt will exit without download packages if the dependencies are missing and unavailable. – dobey Feb 22 '13 at 2:52

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.