RPM
(Specifications) |
m (Relocate references to the bottom of page. Add link to Linux page.) |
||
(10 intermediate revisions by 7 users not shown) | |||
Line 3: | Line 3: | ||
|subcat=Archiving | |subcat=Archiving | ||
|extensions={{ext|rpm}}, {{ext|spec}} | |extensions={{ext|rpm}}, {{ext|spec}} | ||
+ | |pronom={{PRONOM|fmt/793}}, {{PRONOM|fmt/794}}, {{PRONOM|fmt/795}} | ||
+ | |kaitai struct=rpm | ||
}} | }} | ||
− | '''RPM''' (originally Red Hat Package Manager) is a format for software distribution used primarily with Linux. The .rpm file is the distribution archive, | + | '''RPM''' (originally Red Hat Package Manager) is a format for software distribution used primarily with [[Linux]] that uses the said package manager. The <code>.rpm</code> file is the distribution archive, typically comprising of compiled, binary data, ready for use for that specific CPU architecture. For example, <code>.x86_64.rpm</code> corresponds to RPM package typically containing x86_64 or 64bit x86 binaries, for x86_64 machines, <code>.i386.rpm</code> likewise but for 32bit x86 machines, <code>.noarch.rpm</code> are non-CPU architecture specific, etc. <code>.spec</code> files alone are used in the development process to create either RPM or SRPM (<code>.src.rpm</code>) files. |
− | The "payload" of the format is (usually) a [[cpio]] archive, compressed originally with [[gzip]] (but sometimes with other archiving formats in later versions). Headers and a signature are added. | + | The "payload" of the format is (usually) a [[cpio]] archive, compressed originally with [[gzip]] (but sometimes with other archiving formats in later versions).<ref>[https://stackoverflow.com/a/25986787 linux - How do I extract the contents of an rpm? - Ancient rpm2cpio script - Stack Overflow]</ref><ref>[https://stackoverflow.com/questions/18787375/how-do-i-extract-the-contents-of-an-rpm#comment131039986_25933557 linux - How do I extract the contents of an rpm? - ZSTD compressed RPM comment - Stack Overflow]</ref> Headers and a signature are added. |
− | Spec files contain | + | Spec files contain human-readable instructions for <code>rpmbuild</code> tool to build and package a software in RPM (archive) format.<ref>[https://github.com/redhat-developer/rpm-packaging-guide/blob/master/source/packaging-software.adoc#binary-rpms Binary RPMS section - Packaging Software - rpm-packaging-guide - GitHub]</ref> In the SRPM variety of RPM file, the <code>.spec</code> file is included and has details on how to build the package, using either <code>rpmbuild</code> or <code>mock</code><ref>[https://github.com/rpm-software-management/mock/blob/main/docs/index.md#mock Mock - Index.md - rpm-software-management - GitHub]</ref> so that the package can be installed and maintained by RPM package manager itself. |
+ | |||
+ | == Discussion == | ||
+ | RPM packages are not specific to a Linux distribution, e.g. Red Hat (Enterprise) Linux. openSUSE (formerly SuSE) uses RPM to distribute software, and there are many countless examples, derivatives<ref>[[wikipedia:Red_Hat_Enterprise_Linux_derivatives|Red Hat Enterprise Linux derivatives on Wikipedia]]</ref><ref>[https://fedoraproject.org/wiki/Derived_distributions Derived distributions - Fedora Project Wiki]</ref><ref>[https://en.opensuse.org/Derivatives Derivatives - openSUSE Wiki]</ref> notwithstanding. | ||
== Identification == | == Identification == | ||
Line 17: | Line 22: | ||
* [http://rpm.org/max-rpm/s1-rpm-file-format-rpm-file-format.html RPM File Format] | * [http://rpm.org/max-rpm/s1-rpm-file-format-rpm-file-format.html RPM File Format] | ||
* [http://rpm.org/wiki/DevelDocs/FileFormat RPM container file format specification] | * [http://rpm.org/wiki/DevelDocs/FileFormat RPM container file format specification] | ||
+ | |||
+ | == Examples with rpm2cpio and [[Tar#Software|star]] == | ||
+ | ''[[Cpio|cpio]] archives may contain extra metadata such as user/group ID, similar to [[Tar|tarballs]]. However, at the same time, working with <code>.rpm</code> that was compressed with various compressors can prove to be tricky.<ref>[https://stackoverflow.com/a/25986787 linux - How do I extract the contents of an rpm? - Ancient rpm2cpio script - Stack Overflow]</ref> Here is one way using star.'' | ||
+ | |||
+ | List the contents of <code>example.rpm</code>: | ||
+ | rpm2cpio example.rpm | star -tv | ||
+ | Extract the contents of <code>example.rpm</code>: | ||
+ | rpm2cpio example.rpm | star -x | ||
== Software == | == Software == | ||
* [http://rpm.org/wiki/Download RPM] | * [http://rpm.org/wiki/Download RPM] | ||
− | ** <code>rpm2cpio</code> - Can help to open RPM files without installing them | + | ** <code>rpm2cpio</code> - Can help to open RPM files without installing them. Typically combined with a stream decompressor (e.g. Gzip), [[Cpio]] or [[Tar#Software|star]]. |
* [[7-Zip]] | * [[7-Zip]] | ||
+ | * [[Konvertor]] | ||
* [http://rpm.org/wiki/RelatedSoftware Software related to RPM] | * [http://rpm.org/wiki/RelatedSoftware Software related to RPM] | ||
+ | * {{Deark}} | ||
+ | * {{XAD}} | ||
+ | |||
+ | == Sample files == | ||
+ | * {{DexvertSamples|archive/rpm}} | ||
== Links == | == Links == | ||
− | * [[Wikipedia: | + | * [[Wikipedia: rpm (software)]] |
* [http://rpm.org/ Official site] | * [http://rpm.org/ Official site] | ||
* [http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch-specfiles.html Working with spec files] | * [http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch-specfiles.html Working with spec files] | ||
+ | * [https://blog.bethselamin.de/posts/argh-pm.html Argh-P-M! – Dissecting the RPM file format] | ||
+ | |||
+ | == References == | ||
+ | <references/> |
Latest revision as of 11:30, 9 August 2025
RPM (originally Red Hat Package Manager) is a format for software distribution used primarily with Linux that uses the said package manager. The .rpm
file is the distribution archive, typically comprising of compiled, binary data, ready for use for that specific CPU architecture. For example, .x86_64.rpm
corresponds to RPM package typically containing x86_64 or 64bit x86 binaries, for x86_64 machines, .i386.rpm
likewise but for 32bit x86 machines, .noarch.rpm
are non-CPU architecture specific, etc. .spec
files alone are used in the development process to create either RPM or SRPM (.src.rpm
) files.
The "payload" of the format is (usually) a cpio archive, compressed originally with gzip (but sometimes with other archiving formats in later versions).[1][2] Headers and a signature are added.
Spec files contain human-readable instructions for rpmbuild
tool to build and package a software in RPM (archive) format.[3] In the SRPM variety of RPM file, the .spec
file is included and has details on how to build the package, using either rpmbuild
or mock
[4] so that the package can be installed and maintained by RPM package manager itself.
Contents |
[edit] Discussion
RPM packages are not specific to a Linux distribution, e.g. Red Hat (Enterprise) Linux. openSUSE (formerly SuSE) uses RPM to distribute software, and there are many countless examples, derivatives[5][6][7] notwithstanding.
[edit] Identification
Files begin with signature bytes ED AB EE DB
.
[edit] Specifications
[edit] Examples with rpm2cpio and star
cpio archives may contain extra metadata such as user/group ID, similar to tarballs. However, at the same time, working with .rpm
that was compressed with various compressors can prove to be tricky.[8] Here is one way using star.
List the contents of example.rpm
:
rpm2cpio example.rpm | star -tv
Extract the contents of example.rpm
:
rpm2cpio example.rpm | star -x
[edit] Software
[edit] Sample files
[edit] Links
- Wikipedia: rpm (software)
- Official site
- Working with spec files
- Argh-P-M! – Dissecting the RPM file format
[edit] References
- ↑ linux - How do I extract the contents of an rpm? - Ancient rpm2cpio script - Stack Overflow
- ↑ linux - How do I extract the contents of an rpm? - ZSTD compressed RPM comment - Stack Overflow
- ↑ Binary RPMS section - Packaging Software - rpm-packaging-guide - GitHub
- ↑ Mock - Index.md - rpm-software-management - GitHub
- ↑ Red Hat Enterprise Linux derivatives on Wikipedia
- ↑ Derived distributions - Fedora Project Wiki
- ↑ Derivatives - openSUSE Wiki
- ↑ linux - How do I extract the contents of an rpm? - Ancient rpm2cpio script - Stack Overflow