Validate repo visibility and run safe update workflows across RPM, Debian, and Arch families using repeatable commands. Inspect package metadata before install, apply updates predictably, and confirm repository state when installs fail.
You support a mixed fleet and need a standard way to confirm repository visibility, inspect package metadata before installation, and apply updates safely. Your task is to read RPM metadata from a file, install a package on a yum-based system, run the Debian update flow, verify enabled yum repos, and install a package on an Arch-based system.
Patch work fails most often due to missing repo access, incorrect assumptions about which package manager is in use, or skipping “inspect before install.” This lab reinforces commands you can run quickly on unfamiliar systems to prove what the machine can actually see and do.
rpm -qpi before
installing.
yum.apt.
yum repolist.
pacman.rpm -qpi sample.rpm
Use this when someone hands you an RPM and you need confirmation of what it is (name/version/summary) before you install it.
Name : sample
Version : 1.0
Summary : Example RPM package
Description : This is a sample RPM for training purposes.
sudo yum install -y nano
The -y flag is common in automation so the
install can proceed without interactive prompting.
Loaded plugins: fastestmirror
Resolving Dependencies
--> Running transaction check
--> Installing : nano-2.9.8-1.el7.x86_64
Installed:
nano.x86_64 0:2.9.8-1.el7
Complete!
sudo apt update && sudo apt upgrade -y
This is the standard two-phase flow: refresh package indexes, then apply upgrades.
Hit:1 http://deb.debian.org/debian stable InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
Upgrading...
Fetched 12.3 MB in 5s (2,360 kB/s)
Done.
yum repolist
Repo visibility is a fast way to diagnose why a package cannot be found or why updates are failing.
Loaded plugins: fastestmirror
repo id repo name status
base/7/x86_64 CentOS-7 - Base 10,019
updates/7/x86_64 CentOS-7 - Updates 1,002
extras/7/x86_64 CentOS-7 - Extras 500
sudo pacman -S neofetch
Pacman resolves dependencies and prompts before installing. Confirm the plan, then proceed when the transaction is correct.
resolving dependencies...
looking for conflicting packages...
Packages (1) neofetch-7.1.0-2
Total Installed Size: 0.20 MiB
:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring
(1/1) verifying package integrity
(1/1) loading package files
(1/1) checking for file conflicts
(1/1) installing neofetch
First verify repo visibility with yum repolist.
If expected repos are missing, you are dealing with repo
configuration, entitlements, DNS, proxy, or mirror access
before you are dealing with package selection.
Treat this as network or repo access until proven otherwise.
Validate DNS and routing, confirm the configured sources, and
re-run apt update after connectivity is restored.
Confirm the file is actually an RPM and not a different package format or a truncated download. Validate the filename and source before attempting installation.
This is typically mirror or network access. Confirm basic connectivity, then validate mirror configuration before retrying the install.
This lab is safe by default. If you installed packages for the exercise, remove them to return the system to a clean baseline.
sudo yum remove -y nano
sudo apt remove -y nano
sudo pacman -R neofetch
The packages are no longer present, and package managers report a clean state with no failed transactions.
rpm -qpi <file.rpm>
: Query RPM package metadata from a file.
-q
: Query mode.
-p
: Query a package file instead of an installed package.
-i
: Display detailed package information.
yum install <pkg>
: Install a package on yum-based systems.
-y
: Automatically answer “yes” to prompts.
apt update
: Refresh package index information from repositories.
apt upgrade
: Upgrade installed packages to newer versions.
-y
: Automatically confirm upgrades.
yum repolist
: List enabled repositories and available package counts.
pacman -S <pkg>
: Install a package on Arch-based systems.
-S
: Synchronize and install packages from repositories.
yum remove <pkg>
: Remove a package on yum-based systems.
-y
: Automatically answer “yes” to prompts.
apt remove <pkg>
: Remove an installed package on Debian-based systems.
-y
: Automatically confirm removal.
pacman -R <pkg>
: Remove a package on Arch-based systems.
-R
: Remove the specified package.