• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Understanding RPM Versions and Naming Schemes

by admin

RPM is a powerful software manager which can be used to build, install, query, verify, update, and uninstall individual software packages. An RPM package consists of an archive of files, and package information such as name, version, a description and information about dependencies on other RPM packages.

RPM Naming Scheme

Each RPM package is contained in a single file. The filename has several fields to fully identify the contents of the package. While the RPM tools themselves do not rely upon the filename itself, you should understand the filename convention to help you identify or download the proper package.

Here is an example RPM filename:

bash-3.1-16.1.x86_64.rpm

This RPM is for the BASH shell (“/bin/bash”). The filename is composed of several parts:

[name]-[version]-[release].[arch].rpm

where:

  • [name] is the name of the program or package. The [name] is usually assigned by the program’s author. In our example, the developers decided to name their product “bash” for reasons that seemed amusing to them.
  • [version] identifies which edition of the software this RPM contains. The [version] number is assigned by the program’s author. Using the [version] number allows one to determine which version of the author’s sources were used to generate the RPM.
  • [release] provides the edition number of the RPM file itself and not the version of the author’s source files. An updated RPM may be issued to supply a patched version of the author’s original software. The patch need not have come from the original developer, so the RPM [release] gets incremented instead of the [version].
  • [arch] describes the contents of the RPM and tells whether this file contains the product source (a “.src.rpm”), architecture-independent files (a “.noarch.rpm”), or files which may only be installed on a particular host type (a “.sh.rpm” will work only on a STRONGHOLD embedded processor).
Note: the [version] is controlled by the original author and the [release] is controlled by whomever constructed the RPM.

Understanding RPM Versions

The RPM [version] and [release] fields are not always strictly numeric and may contain other characters besides ordinary digits. It is common to see both a version “10” and a “10a” version of the same package. Sometimes picking the most recent version can be tricky. Here is how RPM itself compares version and release numbers internally:

1. Remove the [name] prefix and the “.[arch].rpm” suffix. For example, “bash-3.1-16.1.x86_64.rpm” becomes “3.1-16.1” and “bash-3.1-16.5a.1.x86_64.rpm” becomes “3.1-16.5a.1”

2. Compare the remaining strings character-by-character, left-to-right until a digit is encountered. If the characters differ, whichever character comes later in the collating sequence is the more recent RPM.

3. When a digit is encountered, convert the entire sequence of digits into a single binary number. In our example, the two characters “16” are combined into a value of sixteen (16). The resulting binary values are compared and the greater value is the more recent RPM. Thus, an RPM with a [version] of “0010” is more recent than one with a [version] of “9”.

4. Steps 2 and 3 are repeated as necessary until a difference occurs.

Filed Under: CentOS/RHEL 5, CentOS/RHEL 6, CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. MySQL Fails to Start Using systemctl On systemd Linux Distributions
  2. ufw Command Options
  3. How To Use distro-sync Option With dnf To Upgrade OS (CentOS/RHEL 8)
  4. Rsyslog : How to Send log files to remote server in CentOS/RHEL 6,7
  5. Bind to port 22 on 0.0.0.0 failed: address already in use – error while starting sshd service CentOS/RHEL
  6. CentOS / RHEL 6 : How to Save iptables Rules
  7. CentOS / RHEL 6 : How to Change the Volume Group Name for Root Disk Device
  8. What are the Types of DNS Servers
  9. CentOS / RHEL : How to Disable and Blacklist Linux Kernel Module to prevent it from loading automatically
  10. How to Disable IPv6 in CentOS/RHEL 8

You May Also Like

Primary Sidebar

Recent Posts

  • qemu-system-x86_64: command not found
  • timedatectl: command not found
  • mpirun.openmpi: command not found
  • startkde: command not found

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright