3

I need to install some CPAN module on my Ubuntu computer. I want to install it from deb package so I need to find out what package contains that module.

Sometimes the solution for this task is pretty simple. For example if I need to install File::Find::Rule I just convert the name to lowercase, change :: to - and add lib to the beginning and -perl to the end. The result is the package name libfile-find-rule-perl:

$ apt-cache search libfile-find-rule-perl
libfile-find-rule-perl - module to search for files based on rules

But in other cases this is not working. I want to find deb package that contains Debian::AptContents. But apt-cache search libdebian-aptcontents-perl finds nothing.

Well, in the case of Debian::AptContents I know that it is in the package dh-make-perl, but I want to know how to find what deb package contains the module I need.

Zanna
  • 70,465
bessarabov
  • 2,002
  • Do you want to do this only using the command line? – Radu Rădeanu Oct 13 '13 at 10:41
  • Well, yes, I prefer to solve this problem with the comand line tools. But I'm also interested if there is some web site with this information. I will not use any solution with windows based apps (I don't have X server on my machine), but I will appresiate any kind of solution =) – bessarabov Oct 13 '13 at 12:37

3 Answers3

2

In ubuntu there is a package searching utility called apt-file. You can pass file name to it and it will show you the package containing that file. It search not only the packages that are installed on your system, but also the package that are available for installation.

To find out the deb package that contains Debian::AptContents you should run:

$ apt-file search Debian/AptContents.pm
dh-make-perl: /usr/share/perl5/Debian/AptContents.pm
bessarabov
  • 2,002
1

From a console whereis PACKAGE_OR_COMMON_FILE: it will print any occurrence of a system file.
If you have aptitude use: aptitude search PACKAGE_NAME. If it's present, execute aptitude, find it with the search option and press ENTER to see more information.
If you need info on the module use cpan -D module.