Finding Which Package Provides a File in Ubuntu Linux and Linux Mint

How to find which package provides a file in Debian based releases, such as Linux Mint, Ubuntu?

You can use `dpkg`:

$ dpkg -S /path/to/the/file

-S or --search is the option to make dpkg do a “search”:

-S, --search filename-search-pattern...
    Search for a filename from installed packages.

To search which package provides a command file such as `ps2pdf`:

dpkg -S `which ps2pdf`

More on the dpkg command, check dpkg manual.

Eric Ma

Eric is a systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

Leave a Reply

Your email address will not be published. Required fields are marked *