Package Management (Apt/Dnf/Pacman Internals)
Stop relying on file dates to know what installed that package
đ§© The Challenge
Youâre digging through a server, something is broken, and youâre trying to figure out which package dropped that weird config file into /etc last Tuesday. Checking directory timestamps is a foolâs errand because of how many things touch them.
đĄ The Fix
Use your package managerâs internal database to query the file origin directly. Itâs way faster than guessing which update happened at 3 AM.
rpm -qf /etc/nginx/nginx.conf
dpkg -S /etc/nginx/nginx.conf
âïž Why It Works
These commands look up the file paths inside the local metadata index maintained by the package manager, bypassing the filesystem state entirely. They cut through the noise and show you exactly which package claims ownership of that specific bit on your disk.
đ Pro-Tip: If youâre using dnf, use âdnf providesâ if you donât know the exact path yet.
Linux Tips & Tricks | © ngelinux.com | 11/3/2026
