Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

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
add comment

Your Answer

 
discard

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.