Ubuntu18.4 安装perl5.16
1、切换下载源:
1)、搜索softwares&&update,然后切换源为main server,默认是chain server
2)、执行:sudo apt-get update && sudo apt-get upgrade 需要20分钟~40分钟
3)、sudo apt install gcc
4)、sudo apt install build-essential
sudo wget https://www.cpan.org/src/5.0/perl-5.16.0.tar.gz
2、whereis perl
3、sudo rm -rf allFolder
sudo rm -rf /usr/bin/perl5.26-x86_64-linux-gnu && sudo rm -rf /usr/bin/perl && sudo rm -rf /usr/lib/x86_64-linux-gnu/perl && sudo rm -rf /etc/perl/ && sudo rm -rf /usr/share/perl && sudo rm -rf /usr/share/man/man1/perl.1.gz
4、sudo tar zxvf perl-5.16.0.tar.gz
5、sudo ./Configure --help
Usage: Configure [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
[-U symbol] [-U symbol=] [-A command:symbol...]
-d : use defaults for all answers.
-e : go on without questioning past the production of config.sh.
-f : specify an alternate default configuration file.
-h : print this help message and exit (with an error status).
-r : reuse C symbols value if possible (skips costly nm extraction).
-s : silent mode, only echoes questions and essential information.
-D : define symbol to have some value:
-D symbol symbol gets the value 'define'
-D symbol=value symbol gets the value 'value'
common used examples (see INSTALL for more info):
-Duse64bitint use 64bit integers
-Duse64bitall use 64bit integers and pointers
-Dusethreads use thread support
-Dinc_version_list=none do not include older perl trees in @INC
-DEBUGGING=none DEBUGGING options
-Dcc=gcc choose your compiler
-Dprefix=/opt/perl5 choose your destination
-E : stop at the end of questions, after having produced config.sh.
-K : do not use unless you know what you are doing.
-O : let -D and -U override definitions from loaded configuration file.
-S : perform variable substitutions on all .SH files (can mix with -f)
-U : undefine symbol:
-U symbol symbol gets the value 'undef'
-U symbol= symbol gets completely empty
e.g.: -Uversiononly
-A : manipulate symbol after the platform specific hints have been applied:
-A append:symbol=value append value to symbol
-A symbol=value like append:, but with a separating space
-A define:symbol=value define symbol to have value
-A clear:symbol define symbol to be ''
-A define:symbol define symbol to be 'define'
-A eval:symbol=value define symbol to be eval of value
-A prepend:symbol=value prepend value to symbol
-A undef:symbol define symbol to be 'undef'
-A undef:symbol= define symbol to be ''
e.g.: -A prepend:libswanted='cl pthread '
-A ccflags=-DSOME_MACRO
-V : print version number and exit (with a zero status).
6、sudo apt update
7、sudo apt install build-essential 【如果安装失败,依次执行:】
7.1、sudo apt-get -f -y install
7.2、sudo apt-get update
7.3、sudo apt-get upgrade
7.4、sudo apt install gcc
7.5、gcc --version
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
8、sudo apt install make
9、sudo ./Configure -des -Dprefix=/usr/local/perl -Dusethreads -Uversiononly
10、sudo make
(if error ,find error files and lines,use /* */, delete it.)
11、sudo make install
12、cd /usr/bin/
13、sudo mv perl perl.old
14、sudo ln -s /usr/local/perl/bin/perl /usr/bin/perl
15、perl --version
Ubuntu系统:自带Perl降版本&Perl5.16安装
猜你喜欢
转载自blog.csdn.net/lau_jw/article/details/118934051
今日推荐
周排行