Loading...

Lab 73: Advanced Package Management

Perform deeper package-level triage by verifying installed files, enumerating package contents, and handling reinstall/force install workflows across RPM, dpkg, and pacman-based systems. These checks help you distinguish “broken on disk” from “broken dependency/metadata” and gather evidence before escalation.

packages troubleshooting core

Scenario

A production host is behaving inconsistently and you suspect package corruption or drift. Your task is to verify integrity, inspect installed file lists, perform a controlled force install of an RPM, and validate package consistency on an Arch-based system.

Operator context

Package verification is an evidence-gathering step. If you see modified config checksums or missing files, you can justify a reinstall or rollback rather than treating the 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.

What You’ll Practice

  • Integrity verification on RPM systems: rpm -V <pkg>.
  • Enumerating package contents on Debian systems: dpkg -L <pkg>.
  • Installing/upgrading RPMs with forced overwrite semantics: rpm -ivh --force.
  • Auditing installed package file presence on Arch: pacman -Qk.
  • Reinstalling a package to repair drift: pacman -S <pkg>.

Walkthrough

Step 1 : Verify an RPM package’s integrity (example: bash).
Command
rpm -V bash

rpm -V compares installed files against the RPM database (size, permissions, checksum, timestamps, etc.). Any output indicates a difference that may require review.

S.5....T.  c /etc/bashrc
Step 2 : List installed files for a Debian package (example: bash).
Command
dpkg -L bash

This enumerates the files owned by the package. It’s useful for confirming paths, verifying binaries exist where expected, and validating what will be impacted by removal or reinstall.

/.
 /bin
 /bin/bash
 /usr/share/doc/bash
Step 3 : Force install an RPM (example: test.rpm).
Command
rpm -ivh --force test.rpm

This forces installation even if conflicts exist. In real operations, use this carefully and only when you understand what is being overwritten and why.

Preparing...                          ################################# [100%]
Updating / installing...
   1:test.rpm                        ################################# [100%]
Step 4 : Check for missing package files on Arch.
Command
pacman -Qk

This verifies that files tracked by installed packages exist on disk. Missing file counts can indicate partial deletes, filesystem issues, or unintended cleanup.

bash: 0 missing files
coreutils: 0 missing files
Step 5 : Reinstall a package on Arch (example: bash).
Command
sudo pacman -S bash --noconfirm

A reinstall is a fast remediation path when you’ve confirmed drift or corruption and want to restore known-good package contents from the repository.

:: Retrieving packages...
:: bash-5.2.15-1-x86_64 downloaded
:: Installing bash...

Reference

  • rpm -V <pkg> : Verify installed package files against the RPM database (checksum, size, mode, timestamps, etc.).
  • dpkg -L <pkg> : List files installed/owned by a Debian package.
  • rpm -ivh --force <file.rpm> : Install an RPM while forcing overwrite behavior (use with care).
  • pacman -Qk : Check package file presence and report missing files.
  • pacman -S <pkg> : Install or reinstall a package from configured repos.