in reply to Installing/Upgrading 5.8.8 to 5.12.1

As you've learned, upgrading a Perl installed in any way other than a source build by using a source build will result in pain and suffering. You'll also find out that if you uninstall Perl via yum that it will take half the system with it (including X). So here's my recommendation:

First use rpm -e --nodeps when removing Perl. This will remove the now-damaged Perl without breaking the rest of your system.

Immediately reinstall the base system's Perl pachage, even if it's 5.10 or even 5.8.

In the /usr/lib/perl5 directory, you can remove any 5.x directories that don't match the Perl you just reinstalled, along with anything in /usr/lib/perl5/site_perl that doesn't match your current Perl version.

You can now kill off any other Perl builds you did (in /opt, /usr/local, etc.). Anything that isn't an already-existing path under RH can be removed wholesale (I believe /opt/local falls under that heading); anything that was there before will require careful surgery. The /usr/local one will probably be the most trouble, as there'll be a bunch of scripts installed allong with Perl that end up in /usr/local/bin.

Your best bet after the system Perl is restored and you've built a new one elsewhere is to check the new bin directory and clean out anything that's in there that's also in /usr/local/bin. /usr/local/lib can be handled like the /usr/lib example above, except that any version of Perl you spot in there can go. You may at this point have some leftovers, but they shouldn't cause you any problems.

I highly recommend that you simply ignore the system Perl altogether and do everything via the one you install. Use CPAN with that one to install modules. If for any reason you simply must diddle with the system Perl, only use yum and RPMs; do not use CPAN there, as it will confuse things when it comes to trying to install stuff via RPM. The cpanspec package is useful if you decide that you have loads of time to waste and you want to build your own RPM-based packages (I don't recommend this, if you can't guess!).

  • Comment on Re: Installing/Upgrading 5.8.8 to 5.12.1

Replies are listed 'Best First'.
Re^2: Installing/Upgrading 5.8.8 to 5.12.1
by proceng (Scribe) on Aug 04, 2010 at 04:43 UTC
    I installed perl 5.8.9, 5.10.1 and 5.12.1 (from source) in /usr/local/perl5 (in that order). Do not accept the defaults, install it the long way. Due to the fact that a) I had the time and b) I had the disk space, I made sure that each version did not reference the earlier versions. This way, I have a "clean" install of each (even though they reside in the same upper level directory. You will find perl5.8.9, perl5.10.1 and perl5.12.1 executables in the basedir/bin directory.

    Then I started with the base perl install (using autobundle) and then used the resulting snapshot file to install all base modules to each version (example: "perl5.8.9 -MCPAN -eshell" then "install Snapshot_2010_08_03_01").

    Now, you can add whatever modules you want from CPAN.

    Do not touch the system install (in /usr/bin and /usr/share/perl5). Simply set your non-root path to include /usr/local/perl5/bin before /usr/bin or use explicit paths. Since you defined the base directory during the install, the PATH environment variable (to find the perl executable) is the only one you need.

    Good luck with your project :-)

    Update: To get back to base on your system, do "yum reinstall perl*" (I don't use the -y flag, mainly so that I get out of the habit). If you get into the habit of something like "yum -y reinstall XXX", it is easy to forget and do something like "yum -y remove XXX" which will do exactly what you tell it to: remove the package and all of its dependents. As was noted above, using yum to remove perl will remove the X server among other things without prompting. That will ruin your whole day.

    Update 2:Clarified warning on yum -y.