How to find the package associated with a file in Ubuntu

Sometimes you might be in a sticky situation where you know a filename, directory or path, but would like to know which package installed it or can be installed to obtain it.

The apt-file program is your savior for this situation. Use its search option to find the packages which contain the filename you are looking for. If this program is not present, it can be installed from the Ubuntu repositories.

For example, to find which packages have a filename with Foo in it:

$ apt-file search Foo

Tried with: Ubuntu 12.04.1 LTS

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s