cei has asked for the wisdom of the Perl Monks concerning the following question:

I've got a box with RedHat 6.2's base install. The box isn't live, and has nothing critical on it yet. I'd like to find the best way to replace the 5.005_03 install that's on it with 5.6.

My previous experience moving to 5.6 using CPAN ended up forking my directory structure, taking up space and giving me two copies of all the core modules & libraries. I'd like to avoid that this time around.

What's the cleanest way to get to 5.6? Uninstall the old version with RPM and get a new source from and build it by hand?

Replies are listed 'Best First'.
Re: Clean 5.6 Install
by arturo (Vicar) on Feb 02, 2001 at 21:43 UTC

    Have you tried something along the lines of :

    rpm -Uvh perl-5.6.0.*.rpm ?

    If old directories remain, you can just go through by hand and delete 'em, that shouldn't be too hard.

    Just removing it via RPM (do NOT do it by hand! =) might be hard, because a lot of RPMS depend on Perl (you could rpm -e --nodeps perl-foo, but that can be nasty)

    Actually, RPM can be a pretty handy tool; I'd nab the source RPMS for Perl and do

    rpm --rebuild perl-5.6.0.src.rpm
    and then head to /usr/src/RPM/RPMS/[architecture]/ and do the -Uvh command described above.

    Update I concur with tilly about this particular version, but the upgrade technique is the same for stabler versions =) also, make sure when you get SRPMS to get them for YOUR ARCHITECTURE (mdk RPMS won't necessarily work on RH and vice-versa)


    Philosophy can be made out of anything. Or less -- Jerry A. Fodor

Re (tilly) 1: Clean 5.6 Install
by tilly (Archbishop) on Feb 02, 2001 at 21:51 UTC
    Why do you want to "upgrade" to 5.6.0?

    It happened to be a particuarly bad release. If you want to upgrade then I suggest upgrading to the second 5.6.1 trial release that happened this week. You can find it in Sarathy's directory on CPAN.

    Alternately stick tight with 5.005_03 for a while.

Re: Clean 5.6 Install
by Fastolfe (Vicar) on Feb 02, 2001 at 22:54 UTC
    When upgrading minor versions like this, you generally have nothing to worry about with respects to modules and scripts that might be tailored to the older version. When modules are written that are specialized with one particular version of Perl, or a specific architecture, they will place themselves in a version- or architecture-specific directory in your Perl lib directory (e.g. /usr/lib/perl5). Thus, you can usually have several different versions of Perl running simultaneously on the same system, as each one will only pay attention to its own version-specific subset of Perl modules. Other Perl modules that aren't version-specific sit high in, say, 'site_perl', and can be used by any version or architecture of Perl. This also allows for a reasonable attempt at sharing the same Perl lib directory across the network for multiple systems on multiple architectures with multiple Perl versions, if you so desire.

    So in other words, I wouldn't worry about removing old stuff before installing new stuff. In fact, most major production installations tend to keep both versions around (with Perl binaries referenced as, say, perl5.00503 and perl5.6.1), so that older code that might have a problem with the new version can easily just point itself back to the old Perl binary and still function fine. The only caveat is that a great number of your modules will have to be re-installed/re-built after your upgrade, to populate the 5.6.x library hierarchy, but you'd have to do that anyway with a fresh install.

Re: Clean 5.6 Install
by TheoPetersen (Priest) on Feb 02, 2001 at 23:01 UTC
    I just installed RedHat 6.2 on a bunch of workstations, and faced the same problem. My procedure was:
    rpm -qa | grep perl # I can never remember the name of the RPM rpm -e --nodeps perl-5.0053-whatever.rpm rm -rf /usr/lib/perl5
    Then I went to the NFS-mounted directory where I had built 5.6 and did a make install.

    This has the nice secondary effect of having Perl installed in the same way on my RedHat and other machines, i.e. the library is in /usr/local/lib/perl5 everywhere.

Re: Clean 5.6 Install
by BlueLines (Hermit) on Feb 03, 2001 at 02:20 UTC
    There have already been comments made about the stability of 5.6, so I won't discuss it. On the production boxes at my work, most of our code runs under 5.0053, but some of it takes advantage of newer 5.6 features. Red Hat (by default) installs perl in the /usr hierarchy. So I've been compiling 5.6 by hand, and configuring it with:

    ./configure --prefix=/usr/local/

    Then /usr/bin/perl and /usr/local/bin/perl are 2 totally different things. Red Hat will complain if you try to update the perl rpm, since so much other software depends on perl being installed. So I'd reccommend this route. I mean, you will have 2 copies of core::* installed, but you're still not talking about as much space as Netscape Communicator takes up :-)


    Disclaimer: This post may contain inaccurate information, be habit forming, cause atomic warfare between peaceful countries, speed up male pattern baldness, interfere with your cable reception, exile you from certain third world countries, ruin your marriage, and generally spoil your day. No batteries included, no strings attached, your mileage may vary.
Re: Clean 5.6 Install
by sierrathedog04 (Hermit) on Feb 03, 2001 at 00:06 UTC
    Last month I upgraded my Red Hat 5.1 box from the pre-installed 5.005 to 5.6.

    Everything went smoothly. I did the following:

    1. downloaded the perl 5.6 stable.tar.gz file from
    2. ran gunzip stable.tar.gz
    3. tar -xvf stable.tar
    4. once tar has created a directory for the new Perl, go there and run Makefile.PL
    5. make
    6. make install

    That was literally all I did, and my RH 5.1 box may not be so different from yours. I think the problem may be that you installed the new Perl as an RPM instead of as a tar.gz file.

    While I often use RPMs myself to install non-Perl software in this case it is not necessary. Perl is able to install itself quite nicely without the Red Hat Package Manager.

    In other words, you don't need Linus to help Larry install Perl. Larry knows how to install Perl on his own, even on Linus's OS.