Mastering RPM and YUM: Essential Commands for Linux Package Management
This guide explains Linux package naming conventions, how to inspect binary dependencies and installed libraries, and provides a comprehensive collection of RPM and YUM commands—including installation, query, verification, removal, and repository configuration—to help administrators manage software efficiently.
Package Naming Rules
RPM packages follow the pattern name-Version-release.arch.rpm. Common classifications include the main package ( Application-Version-Arch.rpm), development package ( Application-devel-Version-Arch.rpm), utilities ( Application-utils-Version-Arch.rpm), and libraries ( Application-libs-Version-Arch.rpm).
Viewing Binary Dependencies
Use ldd BINARY_FILE to list the shared libraries required by a binary.
Viewing Loaded Libraries
Run ldconfig -p to display the cache of libraries currently known to the system.
The configuration files that define library search paths are /etc/ld.so.conf.d/*.conf and /etc/ld.so.conf.
Package Manager Overview
RPM provides installation, removal, query, upgrade, and verification operations. An RPM package consists of the payload files, metadata, and optional scripts. The RPM database resides at /var/lib/rpm.
RPM Commands
Installation: rpm {-i|install} [options] PACKAGE_FILE Common options: -v (verbose), -h (progress bar).
Verification of package integrity: rpm -K PACKAGE_FILE Import a signing key: rpm --import KEY_FILE Query operations:
rpm -q PACKAGE_NAME # query by name
rpm -qa # list all installed packages
rpm -ql PACKAGE_NAME # list files installed by a package
rpm -qf FILE_PATH # find which package owns a file
rpm -qi PACKAGE_NAME # detailed package info
rpm -qd PACKAGE_NAME # list documentation files
rpm -qc PACKAGE_NAME # list configuration files
rpm -p PACKAGE_FILE # query an uninstalled packageRemoval: rpm {-e|--erase} [options] PACKAGE_NAME Verification options:
rpm -V [select-options] [verify-options]
S file size
M mode (permissions)
5 MD5 digest
T timestamp
U user ownership
G group ownershipExtract an RPM package:
rpm2cpio PACKAGE_FILE | cpio -idvYUM Repository Management
Repository files are stored in /etc/yum.repos.d/; cache resides in /var/yum/cache. Create a new repo by adding a *.repo file with appropriate baseurl (http, ftp, or file).
YUM Commands
Basic usage:
yum [options] command yum repolist # list all repositories
yum install PACKAGE_NAME # install a package
yum remove PACKAGE_NAME # remove a package
yum search KEYWORD # search packages
yum list # list packages (installed, available)
yum info PACKAGE_NAME # show package details
yum history # show command history
yum clean all # clean all caches
yum groupinstall GROUP_NAME # install a package group
yum groupremove GROUP_NAME # remove a package groupCommon command‑line options: --nogpgcheck (skip GPG verification), -y (auto‑answer yes), -q (quiet), --disablerepo=repoid, --enablerepo=repoid, --noplugins.
Compilation of C/C++ Packages
Typical build steps:
./configure [options] # generate Makefile
make # compile source
make install # install binariesConfigure scripts check dependencies and enable selected features before generating the final Makefile.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
