Candid photograph of a Linux server terminal with a soft olive-green glow against a dark slate background, conveying a calm technical atmosphere.

Step-by-step guides for system administrators — covering command-line basics, web server setup, and preparation material for technical interviews.

Browse Tutorials

Managing RPM packages with practical rpm commands

RPM, short for Red Hat Package Manager, is the package format widely used by RHEL, CentOS Stream, Fedora, and related Linux distributions. Its command-line tools cover installation, upgrades, file ownership, integrity checks, and removal. Linuxtpoint’s hands-on Linux tutorials provide useful background for administrators working beyond a single package command.

Before changing a system, inspect its package database and identify which application owns a particular file. This avoids installing software already present or removing a package that another service depends on. The rpm command is designed for precise package-level operations rather than automatic dependency resolution.

On RHEL, CentOS Stream, and Fedora, DNF is usually the preferred interface because it retrieves dependencies from configured repositories. Direct RPM commands remain valuable for offline systems, installed-package queries, signature checks, forensic inspection, and environments where repository access is restricted.

These examples focus on practical administration rather than RPM database internals. Commands are shown in a form suitable for a root shell, although read-only queries normally do not require elevated privileges.

Inspect installed packages and file ownership

Start with rpm -qa to list every installed RPM package. For readable output, pipe it through less or use rpm -qa | sort. To inspect one package, run rpm -qi nginx; the query information reveals its version, architecture, installation date, licence, and originating repository.

Use rpm -qf /usr/bin/ssh to determine which installed package owns a file. This is particularly helpful when a binary behaves unexpectedly or an administrator needs to verify whether a file belongs to the operating system or a third-party application. A result of “file not owned by any package” identifies an unmanaged file.

To examine an RPM before installation, use rpm -qpl package.rpm to list its contents without unpacking it. For an installed package, rpm -ql nginx lists managed files, scripts, documentation, and configuration paths.

Install and upgrade RPM software

Check a downloaded package with rpm -K package.rpm before installing it. The output should confirm its digital signature and digest. An unknown signing key warrants investigation; disabling signature verification can allow a modified package onto a production server.

Install a new package with sudo rpm -ivh package.rpm, or use sudo rpm -Uvh package.rpm for either a new installation or an upgrade. The verbose flag displays package progress, while -h provides a readable installation summary. The essential Linux commands reference covers many supporting utilities used around this workflow.

Direct RPM installation does not download missing dependencies. If it reports an unsatisfied dependency, install the required provider through DNF and the organisation’s configured repositories. Avoid --nodeps unless the dependency has been deliberately supplied and its compatibility is understood, because bypassing checks can leave libraries or executables in an inconsistent state.

Verify packages and repair configuration drift

The rpm -V package-name command compares installed files against the package metadata and checks file contents, permissions, ownership, and timestamps. For a broad audit, use rpm -Va and review the output during maintenance periods.

Common findings include missing files, altered permissions, unexpected owners, and changed configuration content. These differences may indicate legitimate local customisation rather than corruption. Compare the result with change records before restoring anything, especially for production configuration files.

Prefer sudo dnf reinstall package-name to restore a package through the configured repository. If the repository is unavailable, sudo rpm -Uvh --replacepkgs package.rpm can replace files using the same package version. Back up modified configuration first, and inspect /var/log/dnf.log to determine when a package or file was changed.

Remove packages while protecting dependencies

Use sudo dnf remove package-name for normal removal because DNF checks dependent packages and can propose removing them together. The lower-level equivalent is sudo rpm -e package-name, which should be used when DNF’s dependency handling does not fit the required workflow.

Before removal, identify reverse dependencies with dnf repoquery --whatrequires package-name and inspect the services using the software. dnf check reports unresolved dependencies across the system. Configuration files may be retained during removal, so search their usual directories separately if cleanup is required.

DNF also records transactions in its history. The dnf history command can identify a problematic upgrade, while dnf history undo transaction-id can reverse it when supported. Never delete files directly from /var/lib/rpm; the package database should be modified through RPM or DNF.

Schedule routine package checks

A compact package inventory can be generated with rpm -qa --qf '%{NAME} %{VERSION}-%{RELEASE}.%{ARCH}\n'. Administrators can save this output, compare it with approved software baselines, and schedule regular checks using cron or a systemd timer.

Timezone handling matters in Australia. Sydney moves between AEST and AEDT, while Perth remains on AWST. Use timedatectl to confirm the system timezone and schedule maintenance for a window that accounts for daylight-saving changes. systemctl list-timers --all shows whether systemd timers are active and when they will next run.

When comparing scheduled maintenance with mobile task scheduling, Android’s AlarmManager task scheduling illustrates how timing policies, background execution, and system-managed events affect application behaviour.

Adapt package management for Australian estates

Australian organisations commonly combine cloud workloads in the AWS Sydney and Melbourne regions with on-premises systems in locations such as Brisbane and Perth. Package inventories and update policies should account for different repository access, bandwidth constraints, maintenance windows, and support arrangements across these environments.

In the Australian market, RHEL subscriptions may be purchased through Red Hat, cloud providers, or local resellers. CentOS Stream and Fedora offer upstream-aligned package streams, but production teams still need a defined patching policy, approved repositories, and tested recovery procedures.

Physical appliances or installation media shipped from overseas may pass through Australian Border Force, with duties, GST, and import records applying in some cases. Preloaded software should therefore be inventoried, its licence terms checked, and its package versions recorded before the device enters operational service.

The practical takeaway is to query before changing anything, prefer DNF for dependency-aware work, verify signatures and package state, and retain tested rollback commands. A documented inventory and recovery path give administrators a reliable result across Australian cities, cloud regions, and imported appliances.