Perform package-level triage by verifying installed files, enumerating package contents, and using controlled reinstall and overwrite workflows across RPM, dpkg, and pacman-based systems. Use these checks to separate on-disk drift from metadata or dependency issues before escalation.
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.
rpm -V.
dpkg -L.
pacman -Qk.
rpm -V) and enumerate ownership
(dpkg -L).
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...
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.
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.
rpm -V <pkg>
: Verifies installed package files against the RPM database.
c
marks 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.
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.