Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 know I can list the .deb's dependencies using dpkg --info, but is there any automated way to check those dependencies against the current system? What I'm interested in, the status: whether the package will be cleanly installed, or will it fail.

share|improve this question
up vote 1 down vote accepted

According to the manual: dpkg -i --force-bad-path --dry-run foo.deb. However, it doesn't work, a bug was filed about this 10 years ago.

There is a corresponding option in apt-get and aptitude, but that only applies to packages obtained via apt.

share|improve this answer

Here's a way which is very hackish but does work, sort of.

Make sure you're not root, or you risk overwriting some system files.
Create a temporary directory and change to it.

mkdir root
cp -as /var/lib/dpkg .
rm dpkg/lock dpkg/triggers/Lock
fakeroot dpkg --force-not-root --force-bad-path --admindir=dpkg --instdir=root --log=log -i mypackage.deb

This will unpack the package and then complain about any missing dependencies on stderr. It's likely to return a nonzero status even if there are no missing dependencies because of a failing postinst script.

I haven't tried with a package that has a preinst script, it's possible that dpkg will give up before checking dependencies.

share|improve this answer
Try #3... This time, I tested it (on lenny). – Gilles Aug 5 '10 at 22:11

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.