理论上,你可以下载 python3-elephant 所需的所有软件包,并告诉 rpm 它们都在哪里,但这并不方便。如果 python3-neo 和 python3-quantities 还有其它的运行时要求怎么办?很快,这种“依赖链”就会变得相当复杂。
存储库
幸运的是,有了 dnf 和它的朋友们,可以帮助解决此问题。与 rpm 不同,dnf 能感知到存储库。存储库是程序包的集合,带有告诉 dnf 这些存储库包含什么内容的元数据。所有 Fedora 系统都带有默认启用的默认 Fedora 存储库:
$ sudo dnf repolist repo id repo name status fedora Fedora 30 - x86_64 56,582 fedora-modular Fedora Modular 30 - x86_64 135 updates Fedora 30 - x86_64 - Updates 8,573 updates-modular Fedora Modular 30 - x86_64 - Updates 138 updates-testing Fedora 30 - x86_64 - Test Updates 8,458
在 Fedora 快速文档中有这些存储库以及如何管理它们的更多信息。
dnf 可用于查询存储库以获取有关它们包含的软件包信息。它还可以在这些存储库中搜索软件,或从中安装/卸载/升级软件包:
$ sudo dnf search elephant Last metadata expiration check: 0:05:21 ago on Sun 23 Jun 2019 14:33:38 BST. ============================================================================== Name & Summary Matched: elephant ============================================================================== python3-elephant.noarch : Elephant is a package for analysis of electrophysiology data in Python python3-elephant.noarch : Elephant is a package for analysis of electrophysiology data in Python -
$ sudo dnf list \*elephant\* Last metadata expiration check: 0:05:26 ago on Sun 23 Jun 2019 14:33:38 BST. Available Packages python3-elephant.noarch 0.6.2-3.fc30 updates-testing python3-elephant.noarch 0.6.2-3.fc30 updates
安装依赖项
现在使用 dnf 安装软件包时,它将解决所有必需的依赖项,然后调用 rpm 执行该事务操作:
$ sudo dnf install python3-elephant Last metadata expiration check: 0:06:17 ago on Sun 23 Jun 2019 14:33:38 BST. Dependencies resolved. ============================================================================================================================================================================================== Package Architecture Version Repository Size ============================================================================================================================================================================================== Installing: python3-elephant noarch 0.6.2-3.fc30 updates-testing 456 k Installing dependencies: python3-neo noarch 0.8.0-0.1.20190215git49b6041.fc30 fedora 753 k python3-quantities noarch 0.12.2-4.fc30 fedora 163 k Installing weak dependencies: python3-igor noarch 0.3-5.20150408git2c2a79d.fc30 fedora 63 k -
Transaction Summary ============================================================================================================================================================================================== Install 4 Packages -
Total download size: 1.4 M Installed size: 7.0 M Is this ok [y/N]: y Downloading Packages: (1/4): python3-igor-0.3-5.20150408git2c2a79d.fc30.noarch.rpm 222 kB/s | 63 kB 00:00 (2/4): python3-elephant-0.6.2-3.fc30.noarch.rpm 681 kB/s | 456 kB 00:00 (3/4): python3-quantities-0.12.2-4.fc30.noarch.rpm 421 kB/s | 163 kB 00:00 (4/4): python3-neo-0.8.0-0.1.20190215git49b6041.fc30.noarch.rpm 840 kB/s | 753 kB 00:00 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 884 kB/s | 1.4 MB 00:01 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : python3-quantities-0.12.2-4.fc30.noarch 1/4 Installing : python3-igor-0.3-5.20150408git2c2a79d.fc30.noarch 2/4 Installing : python3-neo-0.8.0-0.1.20190215git49b6041.fc30.noarch 3/4 Installing : python3-elephant-0.6.2-3.fc30.noarch 4/4 Running scriptlet: python3-elephant-0.6.2-3.fc30.noarch 4/4 Verifying : python3-elephant-0.6.2-3.fc30.noarch 1/4 Verifying : python3-igor-0.3-5.20150408git2c2a79d.fc30.noarch 2/4 Verifying : python3-neo-0.8.0-0.1.20190215git49b6041.fc30.noarch 3/4 Verifying : python3-quantities-0.12.2-4.fc30.noarch 4/4 -
Installed: python3-elephant-0.6.2-3.fc30.noarch python3-igor-0.3-5.20150408git2c2a79d.fc30.noarch python3-neo-0.8.0-0.1.20190215git49b6041.fc30.noarch python3-quantities-0.12.2-4.fc30.noarch -
Complete!
请注意,dnf 甚至还安装了python3-igor ,而它不是 python3-elephant 的直接依赖项。
DnfDragora:DNF 的一个图形界面
(编辑:ASP站长网)
|