How to find (Debian / Ubuntu / ...) packages that provide the required Perl modules

I found that installing native Debian or Ubuntu Perl packages is often more reliable and convenient than manually installing Perl modules through cpanm(especially for XS modules). Is there an easy way to find these modules given the list of required Perl modules? The most convenient way would be to display a cpanfile , e.g.

requires 'XML::LibXSLT', '1.78';

to the list of distributions and packages that provide modules for different target platforms:

XML::LibXSLT, Ubuntu 13.04, libxml-libxslt-perl, 1.78
XML::LibXSLT, Ubuntu 13.10, libxml-libxslt-perl, 1.78
XML::LibXSLT, Ubuntu 14.04, libxml-libxslt-perl, 1.84
XML::LibXSLT, Debian squeeze, libxml-libxslt-perl, 1.70
XML::LibXSLT, Debian wheezy, libxml-libxslt-perl, 1.77
XML::LibXSLT, Debian jessie, libxml-libxslt-perl, 1.92
XML::LibXSLT, Debian sid, libxml-libxslt-perl, 1.92

PS: I think that information can somehow be found from the package repositories of each distribution, for example. http://packages.ubuntu.com/ and https://packages.debian.org , but is there a script solution that already does this search?

+4
source share
5 answers

On Debian based systems, install the package dh-make-perland try

dh-make-perl locate XML::LibXSLT

My LMDE field displays:

== dh-make-perl 0.80 ==
Using cached Contents from Thu Sep 18 13:23:19 2014
XML::LibXSLT is in libxml-libxslt-perl package

Linux distromatch. Perl (CPAN) Python . , distromatch . Debian openSUSE.

+6

Simple. . . , .

. ubuntu 12.04, LibXSLT:

$ sudo aptitude search LibXSLT
p   libxml-libxslt-perl                                                           - Perl interface to the GNOME libxslt library                                             
v   libxslt-dev                                                                   -                                                                                         
p   libxslt1-dbg                                                                  - XSLT 1.0 processing library - debugging symbols                                         
p   libxslt1-dev                                                                  - XSLT 1.0 processing library - development kit                                           
i A libxslt1.1                                                                    - XSLT 1.0 processing library - runtime library                                           
p   libxsltc-java                                                                 - XSL Transformations (XSLT) compiler from Xalan-Java                                     
p   libxslthl-java                                                                - XSLT syntax highlighting                                                                
p   python-libxslt1                                                               - Python bindings for libxslt1                                                            
p   python-libxslt1-dbg                                                           - Python bindings for libxslt1 (debug extension)                                          
v   python2.7-libxslt1                                                            -                                                                                         
v   python2.7-libxslt1-dbg                                                        -                           

, , , libxml-libxslt-perl.

+2

, Perl:

dh-make-perl locate XML::LibXSLT

dh-make-perl

+1

Christian Pietsch pau4o dh-make-perl Debian , perl. script cpanfile, dh-make-perl Debian:

#!/usr/bin/perl

# read perl modules as arguments or from ./cpanfile
use Module::CPANfile;
my @modules = @ARGV ? @ARGV : do {
    my $prereqs = Module::CPANfile->load->prereq_specs;
    keys %{$prereqs->{runtime}->{requires}};
};

# locate Debian packages that include these modules 
exit 1 unless @modules;
my $cmd = join ' ', 'dh-make-perl', 'locate', @modules, '2>/dev/null';
open my $fh, "-|", $cmd;
foreach (<$fh>) {
    # this ignore core packages
    # see DhMakePerl::Command::locate for details
    print "$1\t$2\n" if /(.+) is in (.+) package/;
}

perldebs, Perl Debian CPAN. :

$ sudo apt-get install `perldebs | awk '{print$2}'`
$ sudo cpanm --installdeps . --skip-satisfied
0

( ) , synaptic

Ubuntu:

sudo apt-get install synaptic
synaptic

Enjoy

-5

All Articles