1

Before installing a Debian package, I want to check if the current system has all the depending packages installed. Below is what I am currently doing (using bsdgames as an example). Note, I do not want to automatically install dependencies. I just want to know if the current system satisfies the dependency or not. Before you try to answer my question, or mark it as duplicate, please at least read it carefully. Thanks.

$ dpkg -I bsdgames_2.17-21_amd64.deb | grep Depends
Depends: libc6 (>= 2.14), libgcc1 (>= 1:4.1.1), libncurses5 (>= 5.5-5~), libstdc++6 (>= 4.1.1), libtinfo5, wamerican | wordlist

$ apt-cache policy libc6 | grep Installed
Installed: 2.15-0ubuntu10.5

$ apt-cache policy libgcc1 | grep Installed
Installed: 1:4.6.3-1ubuntu5

...

$ apt-cache policy wamerican | grep Installed
$ apt-cache policy wordlist | grep Installed

Then I know two dependencies are missing and the package cannot be installed.

But I have to do this procedure manually, is there any automatic command to check?

Thanks for the help.

1

1 Answer 1

4

A simple thing to do might be to run a simulate command like this.

apt-get --simulate install task-kde-desktop

When running that command you may get a long list of packages that would also be installed in addition to you primary package. Those will be the dependencies.

So this would give me a list of all the packages that will be installed as dependencies if I tried to install task-kde-desktop.

apt-get --simulate install task-kde-desktop | awk '/^Inst / {print $2}' | grep -v 'task-kde-desktop'

Since you are trying to install a dpkg file directly you might want to look at installing and using the gdebi tool. Gdebi (man) basically will install a dpkg and try to handle the dependencies for you.

Not the answer you're looking for? Browse other questions tagged .