RPM
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 |
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.
Identification
Files begin with signature bytes ED AB EE DB
.
Specifications
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
Software
Sample files
Links
- Wikipedia: rpm (software)
- Official site
- Working with spec files
- Argh-P-M! – Dissecting the RPM file format
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