0

我正在尝试执行DateTime::Format::Strptime在我的 RHEL5.8 工作机器上使用的 perl 脚本。执行后我收到错误:

Can't locate object method "am_pm_abbreviated" via package "DateTime::Locale::en" at /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Format/Strptime.pm line 777.

我相信这意味着DateTime::Format::Strptime可能需要比您安装的版本更新的 DateTime::Locale 版本。我尝试使用 yum 安装

sudo yum -y install perl-DateTime-Locale

然而,这与我的供应商 DateTime::Locale 冲突,我收到了冗长且重复的错误交易

Transaction Check Error:
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/Base.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/aa.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/aa_ER_SAAHO.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/af.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/af_NA.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/ak.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/am.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/ar.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/ar_JO.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/ar_LB.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/ar_QA.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/ar_SA.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/ar_SY.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/ar_TN.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/ar_YE.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/as.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/az.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/az_Cyrl.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/be.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/bg.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/bn.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/bo.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/bs.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/byn.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/ca.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/cch.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/cop.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/cs.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/cy.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/da.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/de.pm from install of perl-DateTime-Locale-0.45-1.el5.rf.noarch conflicts with file from package perl-DateTime-0.41-1.el5.x86_64
  file /usr/lib/perl5/vendor_perl/5.8.8/DateTime/Locale/de_AT.pm from install of 

我该如何解决这个问题?

编辑


yum repolist 的输出

repo id                                   repo name                                                                  status
elrepo                                    ELRepo.org Community Enterprise Linux Repository - el5                        444
epel                                      Extra Packages for Enterprise Linux 5 - x86_64                              7,471
rpmforge                                  RHEL 5Client - RPMforge.net - dag                                          11,312
rpmfusion-free-updates                    RPM Fusion for EL 5 - Free - Updates                                          165
repolist: 19,392
4

1 回答 1

1

那很奇怪。DateTime 版本 0.41不包含它所抱怨的任何语言环境文件。

我想知道这是否是 Red Hat 认为他们比 CPAN 作者更了解并做出脑死亡的打包决定的情况之一。您是否可以先更新 DateTime(“sudo yum update perl-DateTime”)可能值得一看。

如果这不起作用,请告诉我们您正在使用哪些 yum 存储库。

更新:进一步调查,我发现 EPEL(这是提供您的 DateTime 副本的存储库)有一个讨厌的 DateTime 包,其中包括 DateTime、DateTime::Locale 和 DateTime::TimeZone。这意味着您不能轻松地自行更新其中一个。我讨厌他们那样做。

不确定这里最好的方法是什么。我想我会为这三个模块构建自己的 RPM 并安装它们而不是 EPEL 模块。但是直接从 CPAN 安装你想要的东西可能更容易。

于 2013-10-11T12:43:07.270 回答