使用 apt-get 时如何找到 Perl 模块的名称

问题描述 投票:0回答:1

使用 apt-get 时,Perl 模块的命名有所不同。 使用 apt-get 时如何找到需要安装的模块的相应命名? 例如: 使用 Sort::Key::Natural qw(natsort) 在 apt-get 中被命名为不同的东西 谢谢!

perl apt
1个回答
5
投票

Debian/Ubuntu/... 软件包的名称源自 Perl 发行版的名称。

Sort::Key::Natural
Sort-Key
分布的一部分。您可以通过访问该模块的 CPAN 页面(第一个链接)找到发行版名称 (
Sort-Key
)。它位于最顶部,在作者姓名之后。

要获取 Debian/Ubuntu/... 软件包名称,请小写 Perl 发行版名称,前缀为

lib
,后缀为
-perl
[1] 这给了我们
libsort-key-perl


或者,您也可以寻找提供

Sort/Key/Natural.pm
的软件包。[2] 一种方法:

apt-file search Sort/Key/Natural.pm

  1. 使用
    "lib" . lc( $distro ) . "-perl"
    获得。
  2. 使用
    ( $module =~ s{::}{/}gr ) . ".pm"
    获得。
© www.soinside.com 2019 - 2024. All rights reserved.