例如,如果我开始安装希腊语言元包,系统会提示我安装其依赖项和弱依赖项。
$ LC_ALL=C sudo dnf install langpacks-el
[sudo] password for roman:
Last metadata expiration check: 4:03:14 ago on Sat Sep 25 13:17:49 2021.
Dependencies resolved.
===============================================================================
Package Arch Version Repository Size
===============================================================================
Installing:
langpacks-el noarch 3.0-14.fc34 fedora 10 k
Installing dependencies:
autocorr-el noarch 1:7.1.6.2-1.fc34 updates 81 k
langpacks-core-el noarch 3.0-14.fc34 fedora 10 k
langpacks-core-font-el noarch 3.0-14.fc34 fedora 10 k
Installing weak dependencies:
glibc-langpack-el x86_64 2.33-20.fc34 updates 512 k
hunspell-el noarch 1:0.9-7.fc34 fedora 1.7 M
hyphen-el noarch 0.20051018-23.fc34 fedora 9.3 k
libreoffice-help-el x86_64 1:7.1.6.2-1.fc34 updates 3.6 M
libreoffice-langpack-el x86_64 1:7.1.6.2-1.fc34 updates 854 k
mythes-el noarch 0.20070412-25.fc34 fedora 161 k
Transaction Summary
===============================================================================
Install 10 Packages
Total download size: 6.9 M
Installed size: 56 M
Is this ok [y/N]:
但是,如果我尝试手动列出依赖项,我看不到弱依赖项。我怎样才能查到它们?
这是我尝试过的。
$ LC_ALL=C dnf repoquery --depends langpacks-el
Last metadata expiration check: 3:15:20 ago on Sat Sep 25 14:07:02 2021.
langpacks-core-el
$ LC_ALL=C dnf repoquery --depends langpacks-core-el
Last metadata expiration check: 3:15:42 ago on Sat Sep 25 14:07:02 2021.
langpacks-core-font-el
$ LC_ALL=C dnf repoquery --depends langpacks-core-font-el
Last metadata expiration check: 3:16:08 ago on Sat Sep 25 14:07:02 2021.
dejavu-sans-fonts
根据手册页:
dnf [options] repoquery [<select-options>] [<query-options>] [<package-file-spec>]
在可用的 DNF 存储库中搜索选定的包并显示有关它们的请求信息。它相当于远程存储库的rpm -q。
- 要看
显示软件包依赖、增强、推荐、建议或补充的功能。
dnf repoquery --depends
仅打印正向依赖项(langpacks-el
包中列为Requires/Recommends/Suggests的依赖项),因此它可以按预期工作,因为“额外”包是通过反向/反向依赖项引入的。例如,该hunspell-el
软件包具有反向弱依赖(此依赖列在hunspell-el
Supplements中),(hunspell and langpacks-el)
这意味着它将在您同时安装hunspell
并安装时langpack-el
安装。使用语言包,这允许只为已安装的包安装语言包——如果您还没有 KDE,您将不会获得 KDE 本地化(kde-l10n-el
也是补充langpacks-el
)。您可以使用打印反向弱依赖项
--whatsupplements
我认为不可能用一个命令同时打印前向和后向依赖项。