CentOS7 安装 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 /usr/local/src

3、 进入文件目录

[root@node1 ~]# cd /usr/local/src/perl-5.26.1/
[root@node1 perl-5.26.1]#  ./Configure -des -Dprefix=/usr/local/src/perl   #/usr/local/src/perl 编译的目录

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

 yum -y install gcc

4、编译并检测

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

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

[root@node1 perl-5.26.1]# make install

6、验证

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

你可能感兴趣的:(linux)