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.
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
andaptitude
, but that only applies to packages obtained via apt.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.
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 thatdpkg
will give up before checking dependencies.