Interview Prep/Linux/Packages, kernel and boot

You need to find which package owns a file, and which files a package installed. How?

BeginnerScenarioPackages, kernel and boot
Answer

Situation read → Package database queries.

What I'd do →

rpm -qf /usr/sbin/sshd          # owner (RHEL)
rpm -ql openssh-server          # files
dnf provides '*/bin/dig'        # which package would provide it
dpkg -S /usr/sbin/sshd          # owner (Debian)
dpkg -L openssh-server
apt-file search bin/dig

Why → Essential when you need to reinstall a damaged file or find what provides a missing command.

Interview tip → rpm -V pkg / debsums pkg verify the files against the package checksums.

All Linux questions Roadmap: Linux

More on Packages, kernel and boot