如何降级到Perl 5.10.1? [英] How to downgrade to perl 5.10.1?

查看:409
本文介绍了如何降级到Perl 5.10.1?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到很多需要perl(:MODULE_COMPAT_5.10.1)的perl模块问题:

I'm running into lots of issues with perl modules requiring perl(:MODULE_COMPAT_5.10.1):

Error: Package: perl-Class-MOP-1.12-1.el6.x86_64 (epel)
           Requires: perl(:MODULE_COMPAT_5.10.1)
Error: Package: perl-Moose-1.15-1.el6.x86_64 (epel)
           Requires: perl(:MODULE_COMPAT_5.10.1)

已安装的perl版本是5.16.3,操作系统是Amazon Linux AMI版本2014.03,我非常想降级到perl 5.10.1,以便解决兼容性问题.我该怎么做?

The installed perl version is 5.16.3, OS is Amazon Linux AMI release 2014.03, and I'd very much like to downgrade to perl 5.10.1 so that the compat issues are fixed. How do I do this?

这种情况在我尝试安装perl-Net-Amazon-EC2时尤其如此,这是yum list shows:

This happens in particular when I try to install perl-Net-Amazon-EC2, here's what yum list shows:

perl-Net-Amazon-EC2.noarch 0.14-2.el6 epel

所以它来自epel,这是回购文件的相应部分:

So it's coming from epel and here's a corresponding section of repo file:

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

好像repo中的版本是0.14,最新的是0.24(我已经尝试过手动安装它,但是它没有用,无论如何我不想为所有软件包手动安装)

Seems like version in repo is 0.14 and the latest is 0.24 (I've tried installing it manually, but it did not work and I in any case don't want to install manually for all the packages)

推荐答案

最简单的方法是安装 Perlbrew .它特定于Linux/Unix,并使用BASH.如果使用Zsh或Kornshell,则需要稍微调整一下脚本.如果您使用的是Windows,那么……祝您好运.

The easiest thing to do is install Perlbrew. It is Linux/Unix specific, and uses BASH. If you use Zsh or Kornshell, you need to munge the scripts a wee bit. If you're on Windows, well... good luck.

Perlbrew将允许您以用户安装的Perls的形式安装Perl的多个版本.您不需要root权限即可使用这些各种版本的Perl.您还可以通过Perlbrew运行CPAN,以在各种版本的Perl中安装模块.这是安装多个版本的Perl进行测试的好方法.我的默认Perl是5.16,所以我已经安装了5.18以获得最新的,5.10、5.12和5.8.9,以尽可能匹配我们在RHEL服务器上运行的Perl的版本.

Perlbrew will allow you to install multiple versions of Perl as user installed Perls. You don't need root permission to use these various versions of Perl You can also run CPAN via Perlbrew to install modules in the various versions of Perl. This is a great way to install multiple versions of Perl for testing purposes. My default Perl is 5.16, so I've installed 5.18 to get the latest, 5.10, 5.12, and 5.8.9 to match as closely as possible the version of Perl we run on our RHEL servers.

要从一种版本的Perl切换到另一种版本,请使用以下命令:

To switch from one version of Perl to another, you use this command:

$ perlbrew use 5.10   # Use this version in the current shell

$ perlbrew switch 5.10  # This is now your default version of Perl

要安装Perl的特定版本,请执行以下操作:

To install a particular version of Perl:

$ perlbrew install 5.10  # I'm installing Perl 5.10!

Perlbrew使用$PATH来设置您的Perl版本,因此您需要谨慎使用shebang.您不必再在/usr/bin/perl下运行Perl.您在Perl脚本中使用的应该是:

Perlbrew uses $PATH to set your Perl version, so you need to be careful with your shebang. You're not necessarily running Perl under /usr/bin/perl anymore. You shebang in your Perl scripts should be:

#! /usr/bin/env perl

比尝试降级默认安装的Perl容易得多.

Way easier than attempting to downgrade your default installed Perl.

这篇关于如何降级到Perl 5.10.1?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆