Monday, May 13, 2013

How to locate files in Ubuntu packages that have not been installed yet.

Many times I have a need to locate a package of a specific file that has not been installed yet.   One way to do this in Ubuntu is to install apt-file:
sudo apt-get install apt-file

Then update the search database by running:
sudo apt-file update


To locate a file run:
apt-file search DateTime.pm
  libatompub-perl: /usr/share/perl5/Atompub/DateTime.pm
  libchart-clicker-perl: /usr/share/perl5/Chart/Clicker/Axis/DateTime.pm
  libdata-faker-perl: /usr/share/perl5/Data/Faker/DateTime.pm
  libdatetime-perl: /usr/lib/perl5/DateTime.pm

While multiple packages contain DateTime.pm, it was fairly obvious which package I needed to install.

No comments:

Post a Comment

Followers