command line tool for searching packages in Ubuntu repositories

Written By smart| 2 July 2009| One Comment

apt-file helps you find a particular file if you have to… say, finish a compilation and you don’t know which package it is contained in or just want to know where to find a certain file which is part of a package you installed.

To install apt-file, run below coomand:

$ apt-get install apt-file

Then we need to update apt-file database with:

$ sudo apt-file update

After some times, once the Contents files are downloaded from the repositories, you will be able to query the database for myfile or path/to/myfile with the following commands:

$ apt-file search myfile

or

$ apt-file search path/to/myfile

Listing the content of an uninstalled package can be done with:

$ apt-file list mypackage

Finally, you can delete the cache files with:

$ sudo apt-file purge

Related Posts with Thumbnails

Share With Others

One Comment »

  • martin (author) said:

    Just use “dpkg -S filename.txt” instead, it’s always installed.

Leave your response!




Comment moderation is enabled. Your comment may take some time to appear.