Introduction
This lesson is about RPM-based package management.
The main question is:
How do you manage packages on RPM-based systems such as RHEL, CentOS, Rocky, Fedora, openSUSE, and similar distributions?
What you should be able to do after this lesson:
- Use
rpmfor package file operations and package queries. - Use
yumorzypperfor repo-based package management. - Recognize where YUM repo config lives.
- Know that
dnfexists as a modern replacement on many systems.
Two Layers: rpm and a Higher-Level Tool
rpm
Low-level package tool for .rpm files.
yum or zypper
Higher-level tools that work with repositories and dependency resolution.
Awareness point:
- many modern systems use
dnf - LPIC still expects you to know
yum
Basic rpm Commands
Install
sudo rpm -ivh package.rpm
Upgrade
sudo rpm -Uvh package.rpm
Important beginner note:
- direct
rpminstallation works on a local package file - repository tools are usually safer for normal admin work because they handle dependency resolution more comfortably
Remove
sudo rpm -e package-name
Query a package
rpm -q package-name
List files from a package
rpm -ql package-name
Find which package owns a file
rpm -qf /usr/bin/ssh
Representative example output:
openssh-clients-9.7p1-1.x86_64
What this shows:
rpm -qftells you which installed package owns a file- RPM package names often include version and architecture
Show package info
rpm -qi package-name
Verify an installed package
rpm -V package-name
Check a package signature
rpm --checksig package.rpm
Integrity and Signatures
RPM can check package integrity and signatures.
The beginner idea:
- RPM can tell you whether a package is installed
- RPM can tell you what files it provides
- RPM can help verify package integrity
yum Basics
Install
sudo yum install package-name
Remove
sudo yum remove package-name
Search
yum search keyword
Representative example output:
====================== Name Exactly Matched: nginx ======================
nginx.x86_64 : A high performance web server and reverse proxy server
What this shows:
- repository tools search package metadata, not just installed files
- the result often includes package name, architecture, and a short summary
Show info
yum info package-name
Reinstall
sudo yum reinstall package-name
zypper Basics
On SUSE-style systems, you may use:
sudo zypper install package-name
sudo zypper remove package-name
zypper search keyword
zypper info package-name
YUM Configuration
Important locations:
/etc/yum.conf
/etc/yum.repos.d/
The idea is simple:
yum.conf= main YUM settings.repofiles = repository definitions
rpm2cpio
This tool lets you extract files from an RPM package archive.
Why you should know it:
- sometimes you want to inspect package contents without installing it
Integrity, Status, and Signatures
For LPIC, RPM is not only about install and remove.
You should also be comfortable with questions such as:
- Is the package installed?
- What version and release is it?
- Which files belong to it?
- Does the package verify correctly?
- Is the package signature valid?
Legacy / Exam Note
In real life, many RPM-based systems now use dnf.
LPIC-1 still expects you to recognize older and broader tool naming:
rpmyumzypperdnfas the modern successor on many systems
This is one of those places where exam coverage is wider than one distro's current default habit.
Practice Step by Step
1) Find which package owns a file
- Run:
rpm -qf /usr/bin/ssh - Read the package name.
2) Search a repository before installing
- Search:
yum search nginx - Inspect:
yum info nginx - If you are on a test system and really want to install it:
sudo yum install nginx
3) Do the same thing on a zypper-based system
- Search:
zypper search nginx - Inspect:
zypper info nginx - If you are on a test system and really want to install it:
sudo zypper install nginx
Cheat Sheet
rpm -ivh= install RPM filerpm -Uvh= upgrade RPM filerpm -e= remove packagerpm -q= query packagerpm -ql= list files from a packagerpm -qf <file>= find package owning a filerpm -qi= show package infoyum install/remove/search/info= repo-based RPM managementzypper install/remove/search/info= SUSE-style repo management/etc/yum.conf= YUM main config/etc/yum.repos.d/= repo definitionsdnf= modern YUM successor on many systemsrpm2cpio= extract files from an RPM archive
Test Your Knowledge
Complete the quiz to assess your understanding of this course's concepts.
