CentOS 安装Perl环境

参考博文:https://blog.csdn.net/weixin_40192129/article/details/78610974

 

vmware tools需要perl环境的支持

安装perl支持

yum install perl* (yum安装perl相关支持) 

yum install cpan (perl需要的程序库,需要cpan的支持,详细自行百度)

注:如果你对perl模块版本要求比较高,希望是新版的那么请按照一下安装:

yum install perl

yum install cpan

以后有什么需要直接用cpan编译安装。

下载perl并安装

下载源码包:

[root@akinlau /]#wget http://www.cpan.org/src/5.0/perl-5.16.1.tar.gz 

解压源码包:

[root@akinlau /]# tar -zxvf perl-5.16.1.tar.gz 

编译并安装,目录可以自定义

[root@akinlau /]# cd perl-5.16.1

[root@akinlau perl-5.16.1]# ./Configure -des -Dprefix=/usr/local/perl

[root@akinlau perl-5.16.1]# make

[root@akinlau perl-5.16.1]# make test

[root@akinlau perl-5.16.1]# make install

如果系统以前已安装了旧版本的perl的话,替换系统原有的版本。

[root@akinlau perl-5.16.1]# mv /usr/bin/perl /usr/bin/perl.bak

[root@akinlau perl-5.16.1]# ln -s /usr/local/perl/bin/perl /usr/bin/perl

再看看是不是最新的版本

[root@akinlau perl-5.16.1]# perl -v

This is perl 5, version 16, subversion 1 (v5.16.1) built for x86_64-linux

Copyright 1987-2012, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the

GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on

this system using “man perl” or “perldoc perl”. If you have access to the

Internet, point your browser at http://www.perl.org/, the Perl Home Page.

如果看到以上信息,就证明安装成功了

注意事项

一个干净的centos系统是没有相关支持的,以至于在操作过程中会出现各类异常,像是编译,像是wget command not found等,整个make的过程是时间非常长的,需要耐心等待。

问题1:wget不被识别

yum install wget

问题2:make命令不被识别

yum install gcc 

reboot 

再次make 

perl -v

原文地址:https://www.cnblogs.com/pipiyan/p/10432262.html