Update Perl version on CentOS 6.6

11,835

Solution 1

If a newer version of Perl is not available as a CentOS update, you have two options:

1) Update your server to a newer version of CentOS that installs the newer version of Perl you need.

2) Download the source code to Perl, and build it yourself.

A word of caution on #2. If you do that, you MUST configure and install an updated version of Perl in such a way that it will not overwrite or interfere, in any way, with the existing CentOS perl package. Many other packages in CentOS depend on Perl, and unless you have sufficient experience in these kinds of things, it's almost a guarantee that building your own version of Perl, and then dumping it on top of the existing system Perl package, overwrititing it, will result in an unstable system, with random, occasional, mysterious failures.

Solution 2

Does this version of Perl have to be accessible to all users? If not, you could try using PerlBrew. PerlBrew allows you to build a user owned version of Perl. In fact, you can install multiple versions of Perl for that user and switch in between them. (Maybe version 5.20.1 has a bug that affects you, and you need to fall back to Perl 5.18).

Since it's user installed, it's easy to keep up to date. You can install new versions or switch between one version of Perl or another with just a single command.

CentOS is kept current with RHEL and not Fedora which is Red Hat's bleeding edge distrobution. Because it's enterprise, the versions of the packages in CentOS are usually much older than what is currently available. This is for stability reasons. You don't want to have your business come crashing down because a bug was introduced in the latest update. At least it's now version 5.10 and not 5.8.9 which it was for years.

Solution 3

Standard Red Hat repositories are extremely outdated. This is a huge issue and the main reason why there are so many paid/subscription repos out there now. But don't worry, there are really good free ones as well. Here are a few that the CentOS folks endorse. You should be able to find the version of Perl your looking for in one of those.

You could also build Perl yourself (only as a last resort!!!), but like Sam Varshavchik said, make sure you build it in a manner that doesn't interfere with the system. In general, you'd want to use make altinstall instead of make install. This method works for me with Python and it should translate over to Perl as well.

Share:
11,835
Admin
Author by

Admin

Updated on September 10, 2022

Comments

  • Admin
    Admin over 1 year

    i have a webserver based on CentOS 6.6 and with perl version 5.10.1 installed.

    Is it possible to update perl and all its modules (mod_perl, ...) to version 5.16 or higher ?

    The is no update available until now at the CentOS repository

    Many thanks for your help.

    John