Determine which package installed a path.
Section: APT and Debian/Ubuntu
Find package owning a file
bash
bash
dpkg -S /usr/bin/psqlExplanation
Very useful when auditing system files.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing APT and Debian/Ubuntu
Upgrade installed packages
Upgrade installed packages without removing old ones.
Perform full upgrade
Handle dependency changes and package removals if needed.