本文介绍了混乱与不同的Perl安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图升级Perl,使我的计算机陷入混乱我当前正在运行RHEL6.5(64位),这是东西:

I tried to upgrade Perl and put my computer into a complete messI am currently running RHEL6.5, 64bits, and this is the thing:

  • 我安装了perl-5.10.1,并且运行良好.这个已经安装好了我可以从yum看到它
  • 我想安装Perl IDE的Padre,但是至少需要v5.11 [我是如此接近! :(]
  • 我可以访问的存储库中没有Perl的较新版本(并且我无法添加新存储库有一个限制)
  • 我得到了老板的批准,可以从www.perl.org下载perl-5.20 .0并尝试安装它.
  • I had perl-5.10.1 installed, and working nice. this came installed,and I could see it from yum
  • I wanted to install Padre, an Perl IDE, but that required at least v5.11 [I was so close! :( ]
  • There were no newer version for Perl in the repos that I have access to (and I have a limitation that I can't add new repos)
  • I got approval from my boss to download perl-5.20 .0 from www.perl.org and tried to install it

...然后混乱开始了!

... and the mess begins!

  • 首先,我使用自己的ID安装了新的perl,然后将其推到了我的主目录下的某个位置
  • 我用'perl -v'进行了测试,可以看到我的env指向的是较新的安装,但是,yum从来没有意识到(这不是真正的问题)
  • 当我尝试安装Padre时,似乎它以某种方式对原始的perl进行了硬编码(来自/usr/bin),并且仍然声称要比5.11更新.
  • 尝试修复它,我确实使用root再次安装了新的perl,以使其在/usr树下推送perl ...已安装,但将perl推送到了/usr/local/bin而不是/usr/bin
  • 因此,我又安装了一个perl,但Padre仍在/usr/bin上寻找它.

我放弃了关于Padre的信息,并删除了与它相关的文件以及安装在我的主目录中的perl,但是我现在已经编写的一些perl脚本抛出了类似以下的错误:

I give up about Padre, and deleted the files related to it, as well as the perl installed on my home dir, however a couple of perl scripts that I had already coded now are throwing errors like:

perl -cw "xmltest.pl" (in directory: /home/myid/scripts/xmltest.pl)
perl: symbol lookup error: /usr/lib64/perl5/auto/Data/Dumper/Dumper.so: undefined symbol: Perl_Istack_sp_ptr
Compilation failed.

...和Data :: Dumper并不是唯一的一个...每次禁用一个模块时,另一个模块都以相同或相似的方式挂起

... and Data::Dumper in not the only one ... every time I disable one of the modules, another one hangs in the same, or similar way

从我读到的内容来看,这个问题似乎与最初为一个perl版本安装的模块有关,并且正由另一个perl版本调用,但是,我已经强迫我直接从CPAN重新安装使用的模块. ,但仍然失败

From what I read about this, seems that this issue is related to modules that were originally installed for one perl version, and are being called by another, however, I already forced the modules that I use to be reinstalled directly from CPAN, and they still failing

问题:如何安全地从当前的perl安装中解脱出来,并执行新的全新安装,以能够在没有这些版本冲突的情况下使用它?

Question: How can I, safely, get free from this current perl installs, and perform a new clean install be able to use it w/o these versions conflicts?

我主要担心的是我拥有许多依赖于Perl的应用程序,但我并没有因此而崩溃

My major concern are about the numerous apps that I have that depends on Perl, and I my not broke then on a uninstall

任何帮助将不胜感激.

推荐答案

您应该:

  1. 清理

  1. cleanup

  • 从任何不需要的路径中清理(注释掉)您的~/.profile,依此类推
  • 从您的$HOME中清除所有新的perl安装(一定要移至安全的地方)
  • 简而言之,请尝试使您的环境恢复到以前的工作状态
  • clean (comment out) your ~/.profile from any unwanted paths, and so on
  • clean any new perl installation from your $HOME (move to safe place for sure)
  • in short, try return your environment into previous working state

重新登录,(注销,登录)

relog, (logout, login)

修复系统perl.就是这个意思,

repair your system perl. Thats mean,

  • 阅读@Sam Varshavchik的答案
  • 使用软件包管理器(5.10)从发行版中重新安装它.
  • 此步骤应覆盖您造成的混乱.
  • 测试!
  • 在您确保一切正常之前,不要继续.

经验教训:切勿覆盖系统perl

  1. 学习

  1. learning

  • read thru perlbrew.pl
  • repeat previous step once again, especially with the
  • the homepage
  • http://perlbrew.pl/Perlbrew-and-Friends.html
  • https://metacpan.org/pod/App::perlbrew
  • https://metacpan.org/pod/perlbrew

安装Perlbrew

installing perlbrew

  • 运行安装命令\wget -O - http://install.perlbrew.pl | bash
  • 应该准确无误地完成
  • 按照说明如何修改您的启动文件,例如~/.profile或此类...(您需要在末尾添加一行)
  • 检查您的~/perl5/perlbrew/bin应包含prelbrewpatchperl
  • run the installation command \wget -O - http://install.perlbrew.pl | bash
  • should finished without errors
  • follow the instructions how to modify your startup file e.g. ~/.profile or such... (you need to add one line to the end)
  • check your ~/perl5/perlbrew/bin should contain prelbrew and patchperl

重新记录

设置新的perl,运行

setup new perl, run

  • perlbrew init #init环境
  • perlbrew available#显示可以安装的Perl
  • perlbrew install 5.20.0#将需要几分钟-取决于您的系统速度
  • perlbrew install-cpanm
  • perlbrew list #check
  • perlbrew switch perl-5.20.0 #activate新安装的perl 5.20
  • perlbrew init #init environment
  • perlbrew available #show what perl you can install
  • perlbrew install 5.20.0 #will take few minutes - depends on your system speed
  • perlbrew install-cpanm
  • perlbrew list #check
  • perlbrew switch perl-5.20.0 #activate newly installed perl 5.20

检查您的安装

  • ~/perl5/perlbrew/bin中,您应该有3个脚本:prelbrewpatchperlcpanm
  • perl -v应该返回5.20
  • type cpanm-应该返回~/perl5/perlbrew/bin/cpanm
  • in the ~/perl5/perlbrew/bin you should have 3 scripts: prelbrew , patchperl , cpanm
  • perl -v should return 5.20
  • type cpanm - should return ~/perl5/perlbrew/bin/cpanm

您完成了.

  1. CPAN模块

您可以使用cpanm安装新模块,例如:

You can install new modules with cpanm, like:

  • applications

  • cpanm cpan-outdated
  • cpanm App::Ack
  • cpanm Unicode::Tussle
  • cpanm Perl::Tidy
  • cpanm Perl::Critic
  • collections

  • cpanm Task::Moose
  • cpanm Task::Plack
  • cpanm Task::Unicode
  • modules

  • cpanm Path::Tiny
  • cpanm Try::Tiny
  • cpanm JSON
  • cpanm YAML
  • etc...

检查~/perl5/perlbrew/perls/perl-5.20.0/bin/中是否有新命令

您需要将您自己的 perl脚本的shebang行更新为

You will need update your own perl script's shebang line to

#!/usr/bin/env perl

我希望不要忘记任何事情,也许其他经验丰富的perl-gurus会添加/编辑/更正更多内容.

I hope don't forget anything, maybe other more experienced perl-gurus will add/edit/correct more.

无论如何,在现实中,步骤5、6、7听起来很容易(通过阅读),并且可以在几分钟内完成.

Anyway, in the reality the steps 5,6,7 are much easier as sounds (by reading this) and could be done in few minutes.

这篇关于混乱与不同的Perl安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-10 19:34