Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I upgrade my perl version in Ubuntu [closed]

Tags:

linux

perl

I don't want to install multiple instances of perl.

How can I upgrade my Perl to latest version or delete existing Perl installation and install a new version of Perl in Ubuntu 14.04. After new installation, will it conflict with older installation files.

like image 562
Bharat Avatar asked Nov 30 '22 10:11

Bharat


1 Answers

I'd do it like this:

wget http://www.cpan.org/src/5.0/perl-5.22.1.tar.gz
tar xvfz perl-5.22.1.tar.gz
cd perl-5.22.1 && ./Configure -Duseithreads -des && make && make test && make install
/usr/local/bin/cpan -u

This puts a source build of perl in /usr/local/bin

Then check your path has /usr/local/bin in it, and if you want typing perl to run your new perl, ensure it's in front of /usr/bin (this is a fairly common scenario, but I can't say for sure if that applies.

Whilst you say you don't want to install multiple perl versions - this is a bad idea.

perl is distributed as part of your operating system. Packages depend upon it, and the particular version. You cannot tell what you might break by altering versions - not least because the way perl handles certain things does change between versions (like hashes).

Messing around with /usr/bin/perl is a road to some future pain (not least - it makes an 'update' of your OS annoyingly difficult, because you can no longer use the package manager without a bit of hackery)

If you REALLY REALLY want to do that you can set -Dprefix= in your Configure options. But as a sysadmin of 15 years experience, I can tell you - no good will come of it, you will break your OS in a variety of minor, but cumulatively really annoying ways. (And maybe some bigger ways)

like image 163
Sobrique Avatar answered Dec 06 '22 07:12

Sobrique