dpkg:--dry-run是否不检查依赖关系?


3

以下实践表明“ dpkg --dry-run”不执行依赖关系检查,或者至少我不知道该怎么做。如果我想确保在安装软件包之前清除依赖关系,该怎么办?非常感谢您的帮助。

$ 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

澄清度

我不希望dpkg为我安装依赖项。我只想要一些命令来检查软件包的依赖关系。如果命令返回0,则表示当前系统具有所有依赖的程序包。这就是我所需要的。

Answers:


3

dpkg不具有依赖项支持。你有两个选择。

1-使用gdebi

sudo apt-get install gdebi-core

gdebi安装deb软件包及其依赖项。

sudo gdebi package.deb

2- sudo dpkg -i *.deb您应该跑步后,

sudo apt-get -f install

2
在运行apt-get -f install之后运行dpkg -i *.deb-是在每次运行之后还是仅在失败时运行?我正在尝试将.debs安装为本地文件,而不是在存储库中,dpkg并且无法满足依赖关系。因此,如果我apt-get随后运行,它将找到本地的.deb。软件包(它在那里,只是使用不能正确安装依赖项dpkg -i),还是只尝试在中配置的存储库sources.list
哈珀维尔'17
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.