Core Operations for RPM-Based Package Management

Installing Packages

Deploy distributions using the installation flag alongside verbose progress tracking. Override default mounting paths with the prefix parameter when necessary, though standard system directories are generally preferred to maintani dependency resolution accuracy. Force mode bypasses existing file locks, which can reconstruct corrupted installation trees.

rpm -ivh app-server-2.1.0-x86_64.rpm
# Relocate target directory
rpm -ivh app-server-2.1.0-x86_64.rpm --prefix=/opt/custom
# Bypass collision checks
rpm -ivh app-server-2.1.0-x86_64.rpm --force

When the local environment lacks required libraries or runtime dependencies, consult external repositories like rpmfind.net to locate compatible archives before proceeding.

Updating and Freshening Software

Differentiate between comprehensive upgrades and targeted freshening based on current deployment states. The upgrade directive handles both initial deployments and version increments, while the freshen directive strictly modifies already-present components.

# Standard upgrade path
rpm -Uvh database-client-1.14.rpm

# Strict freshen (skips absent packages)
rpm -Fvh database-client-1.14.rpm

Removing Deployed Components

Strip software from the filesystem using the erase flag. Dependency validation can be disabled with nodeps, though this may leave orphaned references in the system registry.

rpm -e legacy-toolkit
# Skip dependency resolution
rpm -e legacy-toolkit --nodeps

Identify targets by their truncated package name (legacy-toolkit) rather than the full archive string (legacy-toolkit-7.2.0.rpm).

Inspecting Metadata and Origins

Retrieve detailed manifests or scan filesystem mappings. Queries can evaluate currently deployed binaries or inspect raw payloads prior to placement.

# View comprehensive metadata
rpm -qi nginx-proxy

# List all registered paths within an active package
rpm -ql nginx-proxy

# Inspect unplaced archive contents
rpm -qlp nginx-proxy-1.22.0.rpm

# Trace a binary back to its source distribution
rpm -qf /usr/sbin/nginx-proxy

# Dump dependency requirements
rpm -qR python-devel

# Filter global registry entries
rpm -qa | grep mysql

Validating File Integrity

Compare installed artifacts against repository signatures to detect unauthorized alterations. The verification engine returns a nine-character status string followed by the affected path.

rpm -V mailserver-config
# Verify a specific system file independently
rpm -Vf /etc/postfix/main.cf

Status character decoding:

  • S: Size discrepancy
  • M: Mode (permissions) or type alteration
  • 5: MD5 checksum mismatch
  • D: Device major/minor code change
  • L: Symlink path shift
  • U: Owner ID modification
  • G: Group ID modification
  • T: Modification time drift
  • c: Configuration file indicator
  • d: Regular data file
  • g: Ghost file (ignored by default)
  • l: License document
  • r: README/Description file

Authenticating Package Signatures

Prevent tamperde distributions by validating cryptographic signatures against trusted authority keys. Successful verification permits execution; failures trigger warnings and block deployment.

# Enumerate locally trusted GPG master keys
rpm -qa | grep gpg-pubkey
# Expected output example:
# gpg-pubkey-a1b2c3d4-12345678
# gpg-pubkey-e5f6a7b8-87654321

# Initialize trust chain if certificates are missing
cd /etc/pki/rpm-gpg/
rpm --import CENTOS-GPG-KEY

Extraction mechanics pull cryptographic headers from the distribution for comparison against stored public keys.

Salvaging Individual Archives

Recover lost or altered configuration files directly from the distribution payload without executing a full reinstall.

# Stream payload decompression to disk
rpm2cpio webserver-2.4.51-x86_64.rpm | cpio -idmv ./conf/httpd.conf

Tags: Linux rpm package-management system-administration Security

Posted on Mon, 07 Sep 2026 16:21:23 +0000 by sell-traffic