Scenario
A production host is behaving inconsistently and you suspect package corruption or drift. Your task is to verify package integrity, inspect installed file lists, perform a controlled overwrite install of an RPM, and validate package consistency on an Arch-based system.
Package verification is an evidence-gathering step. If you see modified checksums or missing files, you can justify a reinstall or rollback instead of treating symptoms at the application layer.
Objective
-
Verify an RPM package’s installed file integrity using
rpm -V. -
List installed files for a Debian package using
dpkg -L. - Perform a forced RPM install for a known test package.
-
Identify missing files in installed packages on Arch using
pacman -Qk. - Reinstall a package on Arch to restore a known-good state.
Concepts
-
Verification versus inventory: prove file integrity
(
rpm -V) and enumerate ownership (dpkg -L). - Drift signals: checksum changes, permission changes, and missing files usually point to manual edits or filesystem events.
- Overwrite installs are disruptive: forcing an install can replace files unexpectedly and should be treated as a controlled operation.
- Cross-distro differences matter: the same symptom looks different across rpm/dpkg/pacman ecosystems.
- Evidence first: capture verification output before reinstalling so you can explain what changed and why.
Walkthrough
bash).
rpm -V bash
rpm -V
compares installed files against the RPM database (size,
permissions, checksum, timestamps, etc.). Any output is a
drift signal and should be reviewed before you reinstall or
overwrite files.
S.5....T. c /etc/bashrc
bash).
dpkg -L bash
This enumerates the files owned by the package. Use it to confirm expected paths, verify binaries exist, and understand scope before a reinstall or removal.
/.
/bin
/bin/bash
/usr/share/doc/bash
test.rpm).
Forced installs can overwrite files and destabilize running services. Do this only for known test packages or when you understand exactly what will be replaced.
rpm -ivh --force test.rpm
This forces the install even if conflicts exist. In operations, pair this with prior evidence and a rollback plan.
Preparing... ################################# [100%]
Updating / installing...
1:test.rpm ################################# [100%]
pacman -Qk
This verifies that files tracked by installed packages exist on disk. Missing file counts are common when files were deleted manually or a filesystem event truncated content.
bash: 0 missing files
coreutils: 0 missing files
bash).
sudo pacman -S bash --noconfirm
A reinstall is a fast remediation path when you have confirmed drift and want to restore known-good package contents from the repository.
:: Retrieving packages...
:: bash-5.2.15-1-x86_64 downloaded
:: Installing bash...
Common breakpoints
Config drift is common and not automatically “corruption.”
Check whether the file is marked with
c
in the verify output, and validate changes against expected
config management or documented overrides.
Missing files are a stronger signal. Capture the output, then plan a reinstall or restore from backup. Investigate why the files disappeared (manual deletes, cleanup jobs, disk issues).
Do not force install over core packages without a rollback plan. Use controlled maintenance windows, confirm the package origin, and prefer a managed reinstall path when possible.
If many packages report missing files, treat it as a broader filesystem or cleanup event. Verify disk health and recent maintenance actions before attempting mass reinstalls.
Cleanup checklist
This lab is read-only unless you perform the forced RPM install or a reinstall. Remove the test RPM package if it was used and keep the verification output as evidence for your ticket or incident notes.
# If you installed a test RPM, remove it:
sudo rpm -e test
# Re-run verification after remediation:
rpm -V bash
pacman -Qk
Verification output aligns with expectations (only intended config drift), and missing-file reports are cleared after reinstalling or restoring content.
Reference
-
rpm -V <pkg>: Verifies installed package files against the RPM database.- Output lines indicate drift (checksum, mode, size, timestamps, etc.).
-
cmarks configuration files, which are often intentionally modified.
-
dpkg -L <pkg>: Lists files owned by a Debian package. -
rpm -ivh --force <file.rpm>: Installs an RPM while forcing overwrite behavior (use with care).-
-i: Install. -
-v: Verbose output. -
-h: Print hash marks to show progress. -
--force: Overwrite files and ignore some conflicts.
-
-
pacman -Qk: Checks the presence of files owned by installed packages.- Reports missing files per package, which can indicate deletes or disk issues.
-
pacman -S <pkg>: Installs or reinstalls a package from configured repositories.-
--noconfirm: Proceed without prompts (common in automation).
-
-
rpm -e <pkg>: Removes an installed RPM package.