3

The following practice indicates that "dpkg --dry-run" does not perform dependency checking, or at least I don't know how to do it. If I want to make sure dependency is clear before installing package, what should I do? Thanks a lot for the help.

$ sudo dpkg -i --dry-run bsdgames_2.17-21_amd64.deb 
(Reading database ... 120870 files and directories currently installed.)
Preparing to replace bsdgames 2.17-21 (using bsdgames_2.17-21_amd64.deb) ...

$ echo $?
0

$ sudo dpkg -i bsdgames_2.17-21_amd64.deb 
(Reading database ... 120870 files and directories currently installed.)
Preparing to replace bsdgames 2.17-21 (using bsdgames_2.17-21_amd64.deb) ...
Unpacking replacement bsdgames ...
dpkg: dependency problems prevent configuration of bsdgames:
 bsdgames depends on wamerican | wordlist; however:
  Package wamerican is not installed.
  Package wordlist is not installed.
dpkg: error processing bsdgames (--install):
 dependency problems - leaving unconfigured
Processing triggers for man-db ...
Errors were encountered while processing:
 bsdgames

Clarification

I don't want dpkg to install dependencies for me. I only want some command to check dependency of the package. If the command returns 0, that means the current system has all the depending packages. This is all I need.

2

dpkg doesn'not have dependency support. You have two choises;

1- use gdebi with

sudo apt-get install gdebi-core

gdebi install deb package and their dependency.

sudo gdebi package.deb

2- After sudo dpkg -i *.deb you should run,

sudo apt-get -f install
  • 2
    Is it "common practice" to run apt-get -f install after running dpkg -i *.deb - after every run or just on failure? I am trying to install .debs that are local files and not in a repository and dpkg is failing to meet the dependencies. So, if I run apt-get afterwards, will it find the local .deb. package (it is there, it's just that the dependencies aren't being installed correctly using dpkg -i) or will it only try the repos that are configured in sources.list? – harperville Jul 13 '17 at 20:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.