CentOS7.4 安装 perl 环境

1、 下载安装包

[root@node1 ~]# wget http://search.cpan.org/CPAN/authors/id/S/SH/SHAY/perl-5.26.1.tar.gz
--2018-06-17 16:25:48--  http://search.cpan.org/CPAN/authors/id/S/SH/SHAY/perl-5.26.1.tar.gz
Resolving search.cpan.org (search.cpan.org)... 199.15.176.188
Connecting to search.cpan.org (search.cpan.org)|199.15.176.188|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://www.cpan.org/authors/id/S/SH/SHAY/perl-5.26.1.tar.gz [following]
--2018-06-17 16:25:49--  http://www.cpan.org/authors/id/S/SH/SHAY/perl-5.26.1.tar.gz
Resolving www.cpan.org (www.cpan.org)... 151.101.2.49, 151.101.66.49, 151.101.130.49, ...
Connecting to www.cpan.org (www.cpan.org)|151.101.2.49|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 16939588 (16M) [application/x-gzip]
Saving to: ‘perl-5.26.1.tar.gz’

100%[=================================================================================================================================================>] 16,939,588   699KB/s   in 2m 22s 

2018-06-17 16:28:13 (117 KB/s) - ‘perl-5.26.1.tar.gz’ saved [16939588/16939588]

2、 解压安装包

[root@node1 ~]# tar -zxvf perl-5.26.1.tar.gz -C /opt

3、 进入文件目录

[root@node1 ~]# cd /opt/perl-5.26.1/
[root@node1 perl-5.26.1]#  ./Configure -des -Dprefix=/opt/perl

**注:**如果运行会提示带有cc的语句
请执行此命令 yum -y install gcc

4、编译并检测

[root@root perl-5.26.1]# make && make test

All tests successful. 出现之后我们就可以安装了
CentOS7.4 安装 perl 环境_第1张图片
5、安装

[root@node1 perl-5.26.1]# make install

6、验证

[root@node1 perl-5.26.1]# perl -v

2018-11-08 19:15 更新该图片,感谢一位网友的友情提示,之前可能因为要做演示,没有把之前的版本卸载干净,导致实际安装版本与示例版本的图片不符

CentOS7.4 安装 perl 环境_第2张图片

完毕!!!


如有问题,请留言交流,谢谢

欢迎关注博主公众号:

你可能感兴趣的:(centos)