您好,登錄后才能下訂單哦!
這篇文章主要介紹“RPM包知識點詳細介紹”,在日常操作中,相信很多人在RPM包知識點詳細介紹問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”RPM包知識點詳細介紹”的疑惑有所幫助!接下來,請跟著小編一起來學習吧!
可供用戶選擇的“版本”和“風味版”(spins / labs / silverblue)其實非常相似。它們都是由各種軟件組成的,這些軟件經過混合和搭配,可以很好地協(xié)同工作。它們之間的不同之處在于放入其中的具體工具不同。這種選擇取決于它們所針對的用例。所有這些的“版本”和“風味版”基本組成單位都是 RPM 軟件包文件。
RPM 文件是類似于 ZIP 文件或 tarball 的存檔文件。實際上,它們使用了壓縮來減小存檔文件的大小。但是,除了文件之外,RPM 存檔中還包含有關軟件包的元數(shù)據(jù)??梢允褂?rpm
工具查詢:
$ rpm -q fpastefpaste-0.3.9.2-2.fc30.noarch $ rpm -qi fpasteName : fpasteVersion : 0.3.9.2Release : 2.fc30Architecture: noarchInstall Date: Tue 26 Mar 2019 08:49:10 GMTGroup : UnspecifiedSize : 64144License : GPLv3+Signature : RSA/SHA256, Thu 07 Feb 2019 15:46:11 GMT, Key ID ef3c111fcfc659b9Source RPM : fpaste-0.3.9.2-2.fc30.src.rpmBuild Date : Thu 31 Jan 2019 20:06:01 GMTBuild Host : buildhw-07.phx2.fedoraproject.orgRelocations : (not relocatable)Packager : Fedora ProjectVendor : Fedora ProjectURL : https://pagure.io/fpasteBug URL : https://bugz.fedoraproject.org/fpasteSummary : A simple tool for pasting info onto sticky notes instancesDescription :It is often useful to be able to easily paste text to the FedoraPastebin at http://paste.fedoraproject.org and this simple scriptwill do that and return the resulting URL so that people mayexamine the output. This can hopefully help folks who are forsome reason stuck without X, working remotely, or any otherreason they may be unable to paste something into the pastebin $ rpm -ql fpaste/usr/bin/fpaste/usr/share/doc/fpaste/usr/share/doc/fpaste/README.rst/usr/share/doc/fpaste/TODO/usr/share/licenses/fpaste/usr/share/licenses/fpaste/COPYING/usr/share/man/man1/fpaste.1.gz
安裝 RPM 軟件包后,rpm
工具可以知道具體哪些文件被添加到了系統(tǒng)中。因此,刪除該軟件包也會刪除這些文件,并使系統(tǒng)保持一致狀態(tài)。這就是為什么要盡可能地使用 rpm
安裝軟件,而不是從源代碼安裝軟件的原因。
如今,完全獨立的軟件已經非常罕見。甚至 fpaste,連這樣一個簡單的單個文件的 Python 腳本,都需要安裝 Python 解釋器。因此,如果系統(tǒng)未安裝 Python(幾乎不可能,但有可能),則無法使用 fpaste
。用打包者的術語來說,“Python 是 fpaste
的運行時依賴項?!?/p>
構建 RPM 軟件包時(本文不討論構建 RPM 的過程),生成的歸檔文件中包括了所有這些元數(shù)據(jù)。這樣,與 RPM 軟件包歸檔文件交互的工具就知道必須要安裝其它的什么東西,以便 fpaste
可以正常工作:
$ rpm -q --requires fpaste/usr/bin/python3python3rpmlib(CompressedFileNames) <= 3.0.4-1rpmlib(FileDigests) <= 4.6.0-1rpmlib(PayloadFilesHavePrefix) <= 4.0-1rpmlib(PayloadIsXz) <= 5.2-1 $ rpm -q --provides fpastefpaste = 0.3.9.2-2.fc30 $ rpm -qi python3Name : python3Version : 3.7.3Release : 3.fc30Architecture: x86_64Install Date: Thu 16 May 2019 18:51:41 BSTGroup : UnspecifiedSize : 46139License : PythonSignature : RSA/SHA256, Sat 11 May 2019 17:02:44 BST, Key ID ef3c111fcfc659b9Source RPM : python3-3.7.3-3.fc30.src.rpmBuild Date : Sat 11 May 2019 01:47:35 BSTBuild Host : buildhw-05.phx2.fedoraproject.orgRelocations : (not relocatable)Packager : Fedora ProjectVendor : Fedora ProjectURL : https://www.python.org/Bug URL : https://bugz.fedoraproject.org/python3Summary : Interpreter of the Python programming languageDescription :Python is an accessible, high-level, dynamically typed, interpreted programminglanguage, designed with an emphasis on code readability.It includes an extensive standard library, and has a vast ecosystem ofthird-party libraries. The python3 package provides the "python3" executable: the referenceinterpreter for the Python language, version 3.The majority of its standard library is provided in the python3-libs package,which should be installed automatically along with python3.The remaining parts of the Python standard library are broken out into thepython3-tkinter and python3-test packages, which may need to be installedseparately. Documentation for Python is provided in the python3-docs package. Packages containing additional libraries for Python are generally named withthe "python3-" prefix. $ rpm -q --provides python3python(abi) = 3.7python3 = 3.7.3-3.fc30python3(x86-64) = 3.7.3-3.fc30python3.7 = 3.7.3-3.fc30python37 = 3.7.3-3.fc30
雖然 rpm
知道每個歸檔文件所需的依賴關系,但不知道在哪里找到它們。這是設計使然:rpm
僅適用于本地文件,必須具體告知它們的位置。因此,如果你嘗試安裝單個 RPM 軟件包,則 rpm
找不到該軟件包的運行時依賴項時就會出錯。本示例嘗試安裝從 Fedora 軟件包集中下載的軟件包:
$ lspython3-elephant-0.6.2-3.fc30.noarch.rpm $ rpm -qpi python3-elephant-0.6.2-3.fc30.noarch.rpmName : python3-elephantVersion : 0.6.2Release : 3.fc30Architecture: noarchInstall Date: (not installed)Group : UnspecifiedSize : 2574456License : BSDSignature : (none)Source RPM : python-elephant-0.6.2-3.fc30.src.rpmBuild Date : Fri 14 Jun 2019 17:23:48 BSTBuild Host : buildhw-02.phx2.fedoraproject.orgRelocations : (not relocatable)Packager : Fedora ProjectVendor : Fedora ProjectURL : http://neuralensemble.org/elephantBug URL : https://bugz.fedoraproject.org/python-elephantSummary : Elephant is a package for analysis of electrophysiology data in PythonDescription :Elephant - Electrophysiology Analysis Toolkit Elephant is a package for theanalysis of neurophysiology data, based on Neo. $ rpm -qp --requires python3-elephant-0.6.2-3.fc30.noarch.rpmpython(abi) = 3.7python3.7dist(neo) >= 0.7.1python3.7dist(numpy) >= 1.8.2python3.7dist(quantities) >= 0.10.1python3.7dist(scipy) >= 0.14.0python3.7dist(six) >= 1.10.0rpmlib(CompressedFileNames) <= 3.0.4-1rpmlib(FileDigests) <= 4.6.0-1rpmlib(PartialHardlinkSets) <= 4.0.4-1rpmlib(PayloadFilesHavePrefix) <= 4.0-1rpmlib(PayloadIsXz) <= 5.2-1 $ sudo rpm -i ./python3-elephant-0.6.2-3.fc30.noarch.rpmerror: Failed dependencies: python3.7dist(neo) >= 0.7.1 is needed by python3-elephant-0.6.2-3.fc30.noarch python3.7dist(quantities) >= 0.10.1 is needed by python3-elephant-0.6.2-3.fc30.noarch
理論上,你可以下載 python3-elephant
所需的所有軟件包,并告訴 rpm
它們都在哪里,但這并不方便。如果 python3-neo
和 python3-quantities
還有其它的運行時要求怎么辦?很快,這種“依賴鏈”就會變得相當復雜。
幸運的是,有了 dnf
和它的朋友們,可以幫助解決此問題。與 rpm
不同,dnf
能感知到存儲庫。存儲庫是程序包的集合,帶有告訴 dnf
這些存儲庫包含什么內容的元數(shù)據(jù)。所有 Fedora 系統(tǒng)都帶有默認啟用的默認 Fedora 存儲庫:
$ sudo dnf repolistrepo id repo name statusfedora Fedora 30 - x86_64 56,582fedora-modular Fedora Modular 30 - x86_64 135updates Fedora 30 - x86_64 - Updates 8,573updates-modular Fedora Modular 30 - x86_64 - Updates 138updates-testing Fedora 30 - x86_64 - Test Updates 8,458
在 Fedora 快速文檔中有這些存儲庫以及如何管理它們的更多信息。
dnf
可用于查詢存儲庫以獲取有關它們包含的軟件包信息。它還可以在這些存儲庫中搜索軟件,或從中安裝/卸載/升級軟件包:
$ sudo dnf search elephantLast 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 Pythonpython3-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 Packagespython3-elephant.noarch 0.6.2-3.fc30 updates-testingpython3-elephant.noarch 0.6.2-3.fc30 updates
現(xiàn)在使用 dnf
安裝軟件包時,它將解決所有必需的依賴項,然后調用 rpm
執(zhí)行該事務操作:
$ sudo dnf install python3-elephantLast 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 kInstalling dependencies: python3-neo noarch 0.8.0-0.1.20190215git49b6041.fc30 fedora 753 k python3-quantities noarch 0.12.2-4.fc30 fedora 163 kInstalling weak dependencies: python3-igor noarch 0.3-5.20150408git2c2a79d.fc30 fedora 63 k Transaction Summary==============================================================================================================================================================================================Install 4 Packages Total download size: 1.4 MInstalled size: 7.0 MIs this ok [y/N]: yDownloading 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:01Running transaction checkTransaction check succeeded.Running transaction testTransaction 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
的直接依賴項。
盡管技術用戶可能會發(fā)現(xiàn) dnf
易于使用,但并非所有人都這樣認為。Dnfdragora 通過為 dnf
提供圖形化前端來解決此問題。
dnfdragora (version 1.1.1-2 on Fedora 30) listing all the packages installed on a system.
從上面可以看到,dnfdragora 似乎提供了 dnf
的所有主要功能。
Fedora 中還有其他工具也可以管理軟件包,GNOME 的“軟件”和“發(fā)現(xiàn)”就是其中兩個。GNOME “軟件”僅專注于圖形應用程序。你無法使用這個圖形化前端來安裝命令行或終端工具,例如 htop
或 weechat
。但是,GNOME “軟件”支持安裝 dnf
所不支持的 Flatpak 和 Snap 應用程序。它們是針對不同目標受眾的不同工具,因此提供了不同的功能。
到此,關于“RPM包知識點詳細介紹”的學習就結束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學習,快去試試吧!若想繼續(xù)學習更多相關知識,請繼續(xù)關注億速云網站,小編會繼續(xù)努力為大家?guī)砀鄬嵱玫奈恼拢?/p>
免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經查實,將立刻刪除涉嫌侵權內容。