Mess with different Perl installations

I tried to upgrade Perl and put my computer in a complete mess I am currently running RHEL6.5 64 bit and this is what:

  • I had perl-5.10.1 installed and it worked well. it was installed and i could see it from yum
  • I wanted to install Padre, Perl IDE, but that required at least v5.11 [I was so close! :(]
  • There was no new version for Perl in the repos that I have access to (and I have the limitation that I cannot add new repositories)
  • 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!

  • I first installed a new perl with my own id and that pushed perl somewhere under my home dir
  • I tested with "perl -v" and could see my env was pointing to a fresh install, however yum never recognized it (not a problem)
  • When I tried to install Padre it seems like it had the hardcoded original perl (from / usr / bin) and still required something newer than 5.11.
  • Trying to fix this, I installed a new perl again, now using root to make it push perl under the / usr tree ... it is installed, but pushed perl to / usr / local / bin instead of / usr / bin
  • So again I had another perl install but Padre was still looking for one in / usr / bin

I am giving up Padre and deleting its associated files as well as the perl installed in my home directory, however a few perl scripts I have already coded now throw 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.

      

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

From what I read about it, it seems that this problem is related to modules that were originally installed for one version of perl and called by another, however I have already forced the modules that I am using to reinstall directly from CPAN and they still suffer failure

Question . How can I safely free myself from this current perl installation and do a fresh clean install so that I can use it without conflicts between these versions?

My main concern with the numerous applications I have is Perl dependent and I haven't broken the removal

Any help would be much appreciated.

+3


source to share


3 answers


You must:

  • Cleaning

    • clear (comment out) yours ~/.profile

      of any unwanted paths etc.
    • clean any new perl installation from $HOME

      (go to a safe place)
    • return the environment to its previous working state
  • relog, (logout, login)

  • rebuild your perl system. It means,

    • read @Sam Varshavchik answer
    • reinstall it from your distribution using your package manager (5.10).
    • This step should overwrite the mess you caused.
    • check it out!
    • do not continue until you are sure everything is working correctly as before.

Lesson learned: never overwrite your perl system

  1. learning

  2. installing perlbrew

    • run the install command \wget -O - http://install.perlbrew.pl | bash

    • should complete without errors
    • follow the instructions to change the startup file eg. ~/.profile

      or this ... (you need to add one line at the end)
    • check what your ~/perl5/perlbrew/bin

      should contain prelbrew

      andpatchperl

  3. Relog

  4. set up new perl, run

    • perlbrew init

      #init environment
    • perlbrew available

      #show that you can install perl
    • perlbrew install 5.20.0

      # will take a few minutes - depends on the speed of your system.
    • perlbrew install-cpanm

    • perlbrew list

      #check
    • perlbrew switch perl-5.20.0

      # activate the newly installed perl 5.20

Check your installation

  • in ~/perl5/perlbrew/bin

    you should be 3 script: prelbrew

    , patchperl

    ,cpanm

  • perl -v

    should return 5.20
  • type cpanm

    - should return ~/perl5/perlbrew/bin/cpanm

You are done.

  1. CPAN modules


You can install new modules with cpanm

, for example:

Check out ~/perl5/perlbrew/perls/perl-5.20.0/bin/

for new teams

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

#!/usr/bin/env perl

      

I hope not to forget anything, maybe other more experienced perl gurus will add / edit / fix more.

Anyway, in action steps 5,6,7 are much easier than sounds (reading this) and can be done in a few minutes.

+7


source


On Linux based rpm distributions, you should never install system software manually, for example trying to compile and build it yourself. RHEL's package management tool, rpm, has an important function in keeping track of package dependencies and preventing package conflicts.

The errors you listed are exactly symptoms of a corrupted Perl installation system, and rpm is there to avoid this kind of thing. Manually creating and installing random archives completely bypasses the protective mesh provided by rpm.

There is no cookie cutter recipe for recovering from a damaged critical system installation like perl, but in general:

1) run "rpm -q" perl, this will show you the exact version of the perl rpm package that is believed to be installed.

2) go to your RHEL installation media / directory, make sure it contains the same perl-.x86_64.rpm package. If you have installed RHEL updates before, it is possible that you have already updated perl, so find the version that rpm says you installed in the RHEL update directory and make sure you have the correct rpm package.

3) Run:



rpm -ivh --force perl-<version>.x86_64.rpm

      

This will reinstall the original perl RPM package that was previously installed. Your problem is not only that you have additional versions of perl, but probably some of your custom perl builds have compiled the system perl package and removing them will not help, you need to reinstall the perl system.

4) In RHEL, many perl modules are installed as separate packages. The above process should be used to reinstall every perl rpm package you have installed. Performance:

rpm -q -a | grep '^perl'

      

This will give you a list of all Perl packages that you have installed. You will need to repeat this procedure for each Perl RPM package.

This is not a 100% guarantee that this will fix everything, there may be other errors, but this is a good first step towards recovery.

+4


source


What I've done:

From @ Sam-Varshavchik's answer:

  • Found the previous perl rpm in my yum cache and installed ... rpm -ivh --force perl-<version>.x86_64.rpm

  • Checked for other "perl *" packages previously installed ... it was +260 so it saved it in a file rpm -qa "perl*" > /tmp/perl.pkgs

  • With +260 to install, I realized that doing it manually was taking too long, so it was time to put some ksh skills into practice ...

    I checked in my yum cache and found ~ 130 packages +260 so

    • took out the base perl package (which I already installed) from the list;
    • for those in the cache, I decided to install then with rpm, just like the base package;
    • for those I was not comfortable with, I used yum which would download and do the same rpm, so ...

    CACHE="/var/cache/yum/x86_64" for perlpkg in $(cat /tmp/perl.pkgs) do FILE=$(find $CACHE -name "${perlpkg}.rpm") if [[ ${FILE} != "" ]] ; then rpm -ivh --force ${FILE} else yum -y reinstall ${perlpkg} fi done

From @ jm666:

  1. Perlbrew installed (was able to get it from my auth repos so got it with yum) and using perlbrew installed 5.20.0 localy

    • TODO: there were no additional modules, and no Padre yet ... need to learn more about how perlbrew works and isolate the installed version from the perl system

Thanks again @ Sam-Varshavchik and @ jm666 for the angel support tip

0


source







All Articles