Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How 'bad' is replacing /usr/bin/perl with /usr/local/bin/perl on CentOS?

ANSWERED: Basically, it can be done with no major side-effects if you compiled your own perl and you did it the same way your OS did. While it isn't a recommended practice, I've been able to run like this for more then a month. I would conclude it is relatively safe to do if you know what you are doing.

We came to the conclusion at work today that we needed to upgrade perl to 5.10.0 CentOS 5.x comes with perl 5.8.8.

We determined that the effort involved in maintaining scripts with #!/usr/bin/perl was futile.

According to some install stuff on CPAN and other places, it isn't a 'good' idea to replace the OS's version of perl. I already updated the link in /usr/bin/. So my question is, how bad is it really to replace /usr/bin/perl?

I've not noticed any adverse effects in our systems yet, but I'm prepared to correct the link (back to 5.8.8) as soon as there is a problem.

I'm worried that there may be some modules in the CentOS standard distro that aren't included in CPAN's source 5.10.0. I'm still trying to figure out what those modules might be.

Thanks in advance.

like image 805
CIAduck Avatar asked Jun 22 '11 04:06

CIAduck


1 Answers

In my experience, the best practice is to compile your entire stack (Perl, Apache, ImageMagick, ...) from source yourself. That gives you complete control over which versions of everything are used and when everything gets upgraded.

Replacing /usr/bin/perl with one you compiled is a crap shoot. The OS might be using /usr/bin/perl as part of its maintenance or init scripts so changing it could brick your server or cause strange failures.

So ignore the system Perl, build your own, and fix your scripts to refer to your version of Perl.

like image 154
mu is too short Avatar answered Nov 08 '22 23:11

mu is too short