Merry Christmas & Happy 2027! Less downtime. More good times. Celebrating 13 years of sorlavit.com
Skip to content
Sorlavit KimIT Support, Network & Infrastructure Services Let’s talk

Articles are written in English. The Thai translation button opens Google Translate; code and commands stay in their original form.

Linux Commands / IT Support Guides

Find the Debian package that owns a file

Use dpkg-query to find which installed Debian or Ubuntu package registered a file.

Compiled for Sorlavit Kim · Published · Updated · 1 min read

Environment and inputs: Linux · Bash-compatible shell; package and service names vary by distribution

Understand the problem

Use a Debian-based system with dpkg. Check the path you want to look up. A command name alone may refer to more than one executable.

Run the command

Run dpkg-query -S with the absolute path. The example searches for /bin/bash.

dpkg-query -S /bin/bash

Read the output

A result such as bash: /bin/bash means the installed package database registers that path under the bash package.

Choose the next step

If there is no match, check the other spelling of the path on systems where /bin points to /usr/bin. Locally installed files and some generated files may have no registered package owner.

Before making changes

Package ownership tells you which package registered the path. Check file integrity separately if you need to know whether the installed bytes have changed.

Share this article

Back to all articles