Find Debian Package that Provides File on Ubuntu

Find Debian Package that Provides File on Ubuntu

Whether you're troubleshooting, seeking dependencies, or just curious about the origins of a file on the Ubuntu system, determining which Debian package provides it can be useful. This tutorial shows how to find a Debian package that provides a file on Ubuntu.

If you already have the file on the system but are unsure which package it belongs to, you can use the dpkg-query or dpkg command with -S option to find out:

dpkg-query -S /bin/mkdir
dpkg -S /bin/mkdir

In this case, the command output the package that owns the file /bin/mkdir. Example:

coreutils: /bin/mkdir

If the package for which the file belongs to is not found, the command will output an error message, such as:

dpkg-query: no path found matching pattern ...

Leave a Comment

Cancel reply

Your email address will not be published.