perl版本升級記錄
工作需要,perl版本太舊不支持相關功能,所以進行版本升級
注意:為了系統的穩定以及更好地管理,適當進行備份,一般遵循
- 不先rm -rf
- 先下載tar.gz 文件,然後手動 安裝到/usr/local/bin/目錄下
- /usr/bin/perl 建立軟連接到 /usr/local/bin/perl
1、安裝
find / -name perl
#查詢perl路徑,確認相關
tar -zxvf perl-5.26.0.tar.gz
#解壓壓縮包
cd perl-5.26.0
#進入文件目錄
./Configure -des -Dprefix=/usr/local/perl
#指定編譯安裝路徑
make
make test
make install
#如出現cc錯誤,安裝基礎環境 yum -y install gcc
#如果這個過程沒有錯誤的話,那么恭喜你安裝完成了.
2、替換
##但是這只是安裝完成了,並沒有與系統契合,系統使用的還是舊版本
#so 干掉舊版本
mv /usr/bin/perl /usr/bin/perl.bak
#備份,程序員的日常
ln -s /usr/local/perl/bin/perl /usr/bin/perl
#建立新的軟連接,使安裝的perl生效
3、檢測
#檢測
perl -v
This is perl 5, version 26, subversion 0 (v5.26.0) built for i686-linux
Copyright 1987-2017, 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.
#成功
