Ser*_*zar 1 linux perl redhat rpm
我试图在 RPM 包中捆绑一堆 Perl 模块以便于部署。我尝试了很多工具,但最终选择了 fpm ( https://github.com/jordansissel/fpm )。
因此,我设法为每个必需的 Perl 模块手动构建和安装每个 RPM。我不确定这是正确的。但是我对 RPM 包没有很多经验。但据我所知,这是正确的行为。每个 RPM 包都包含相应 Perl 模块所需的所有依赖项。
问题是当我尝试使用生成的包来安装我的模块时,我遇到了一些冲突。
sudo yum --disablerepo=* localinstall *.rpm
Run Code Online (Sandbox Code Playgroud)
当它尝试安装时:
Transaction Summary
==============================================================================================================================================================================================================
Install 174 Packages
Total size: 45 M
Installed size: 357 M
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Error: Transaction test error:
file /usr/local/lib64/perl5/auto/Moose/Moose.so conflicts between attempted installs of Moose-Exporter-2.2013-1.x86_64 and Moose-2.2013-1.x86_64
file /usr/local/lib64/perl5/auto/Moose/Moose.so conflicts between attempted installs of Moose-Role-2.2013-1.x86_64 and Moose-Exporter-2.2013-1.x86_64
file /usr/local/lib64/perl5/auto/Moose/Moose.so conflicts between attempted installs of Moose-Util-TypeConstraints-2.2013-1.x86_64 and Moose-Role-2.2013-1.x86_64
file /usr/local/lib64/perl5/auto/Moose/Moose.so conflicts between attempted installs of Moose-Util-2.2013-1.x86_64 and Moose-Util-TypeConstraints-2.2013-1.x86_64
file /usr/local/lib64/perl5/auto/Moose/Moose.so conflicts between attempted installs of Moose-Meta-TypeConstraint-2.2013-1.x86_64 and Moose-Util-2.2013-1.x86_64
file /usr/local/lib64/perl5/auto/Moose/Moose.so conflicts between attempted installs of Moose-Meta-TypeConstraint-Union-2.2013-1.x86_64 and Moose-Meta-TypeConstraint-2.2013-1.x86_64
file /usr/local/lib64/perl5/auto/Moose/Moose.so conflicts between attempted installs of Moose-Util-MetaRole-2.2013-1.x86_64 and Moose-Meta-TypeConstraint-Union-2.2013-1.x86_64
file /usr/local/lib64/perl5/auto/Moose/Moose.so conflicts between attempted installs of Moose-Meta-Attribute-2.2013-1.x86_64 and Moose-Util-MetaRole-2.2013-1.x86_64
file /usr/local/lib64/perl5/auto/Moose/Moose.so conflicts between attempted installs of Moose-Meta-Class-2.2013-1.x86_64 and Moose-Meta-Attribute-2.2013-1.x86_64
file /usr/local/lib64/perl5/auto/Moose/Moose.so conflicts between attempted installs of Moose-Meta-Role-2.2013-1.x86_64 and Moose-Meta-Class-2.2013-1.x86_64
file /usr/local/lib64/perl5/auto/Moose/Moose.so conflicts between attempted installs of Moose-Meta-Role-Attribute-2.2013-1.x86_64 and Moose-Meta-Role-2.2013-1.x86_64
file /usr/local/lib64/perl5/auto/HTML/Parser/Parser.so conflicts between attempted installs of HTML-HeadParser-3.75-1.x86_64 and HTML-Entities-3.75-1.x86_64
Run Code Online (Sandbox Code Playgroud)
我花了几天时间试图调试这个问题,但我似乎无法弄清楚。我所做的只是使用 yum 安装 perl,因为这是先决条件。我希望我的本地安装会起作用。
错误消息似乎很清楚:您不能让两个包提供相同的文件。
对于周围的错误Moose.so,您可能希望将共享库移动到一个单独的包中,并使其成为所有需要它的模块的依赖项。
对于周围的错误HTML-HeadParser,我认为您只需拥有一个HTML-Parser包,然后就可以制作类似HTML-HeadParser并HTML-Entitities依赖于它的东西。
也许花点时间看看现有的 Perl 模块是如何打包的?例如,看看:
perl-Moose-*和perl-MooseX-*包。