【问题标题】:Perl DateTime::Locale::en errorPerl DateTime::Locale::en 错误
【发布时间】:2013-10-11 11:58:29
【问题描述】:

我正在尝试在我的 RHEL5.8 工作机器上执行一个使用 DateTime::Format::Strptime 的 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

【问题讨论】:

    标签: linux perl datetime yum rhel


    【解决方案1】:

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

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

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

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

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

    【讨论】:

    • 脚本已经是最新的。问题已编辑显示 repolist
    • 您可以从 DAG/rpmforge 存储库 dag.wiee.rs/rpm 获得 DateTime 的健康副本
    猜你喜欢
    • 1970-01-01
    • 2021-03-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-23
    • 1970-01-01
    • 2023-04-01
    • 1970-01-01
    相关资源
    最近更新 更多