Perl module installation and update source step detailed

Source: Internet
Author: User
Tags gpg


Description
When you configure some services, you need to install the Perl module. There are two ways to install the Perl module: Manual Installation and automatic installation.
The perl–mcpan–e ' Install XXX ' automatically installs the Perl module, the module is not down, most likely the Perl source is not set up, then need to update the Perl source.



Realize:
A. Perl module installation
1.perl Module Manual Installation
On CPAN, such as search.cpan.org to search for the modules you want to install:
Download TAR-ZXVF XXX Uncompressed
First look at the Readme Ah, to develop good habits, Perl has a lot of related modules, you may want to let you first install this one, do not finally find out how did not install? It's 2.
There's no problem with that: Perl makefile.pl
Continue no problem: make
No problem: Make install
Shipping installation is more troublesome. To search the relevant web site for the required modules, and then download the source package to install (Installation process: Perl makefile.pl;make;make install). However, this method is more cumbersome, each module to search, download, decompression, compilation, installation. Through the # perl-mcpan-e "Install xxx::xxx" automatic installation faster.



2.perl Module Automatic Installation


The code is as follows
# PERL-MCPAN-E Shell//Enter CPAN interface
cpan> Install XXX


XXX for the Perl module to be installed, of course, can also directly # perl–mcpan–e ' Install xxx ' after a heap of settings for CPAN, if the Perl source is not good, it will appear in the download slow or can not download at all. You can then modify the Perl source.



Two. To update the Perl source, Perl Source modification has 3 ways:
1. Directly delete the CPAN configuration file and related software


The code is as follows
# Cd/etc/perl/cpan
# RM CONFIG.PM
# Cd/root/.cpan//This directory was created at the beginning of initialization of CPAN with root account
# RM-RF *
# PERL-MCPAN-E Shell//Then reconfigure CPAN, which is equivalent to the first use of CPAN automatic installation features


2. Reconfigure, if you want to reconfigure CPAN, you can enter the CPAN first


The code is as follows
# PERL-MCPAN-E Shell
cpan> o conf init//input at the CPAN command line, and then modify each option in the following query
Cpan> Reload Index///after modification through reload index, reload CPAN to update
Cpan> Reload CPAN


3. Change config.pm, anyway set up in here, lazy people will change this is OK


The code is as follows


# Find/-name comfig.pm//or Whereis comfig.pm, note case
# VI/USR/LIB/PERL5/5.8.8/CPAN/CONFIG.PM//Post configuration, according to experience this configuration is a problem with the meter (the problem is also the RP problem)
# This is cpan.pm ' s systemwide configuration file. This file provides
# Defaults for users, and the values can is changed in a per-user
# configuration file. The User-config file is being looked for as
# ~/.cpan/cpan/myconfig.pm.


$CPAN:: Config = {
' Build_cache ' => q[10],
' Build_dir ' => q[/home/chenbiyan/.cpan/build],
' Cache_metadata ' => q[1],
' Cpan_home ' => Q[/home/chenbiyan/.cpan],
' Dontload_hash ' => {},
' FTP ' => q[/usr/kerberos/bin/ftp],
' Ftp_proxy ' => q[], #有用代理的记得设置下
' GETCWD ' => Q[CWD],
' GPG ' => q[/usr/bin/gpg],
' gzip ' => Q[/bin/gzip],
' Histfile ' => q[/home/chenbiyan/.cpan/histfile],
' Histsize ' => q[100],
' Http_proxy ' => q[],
' Inactivity_timeout ' => q[0],
' Index_expire ' => q[1],
' Inhibit_startup_message ' => q[0],
' Keep_source_where ' => q[/home/chenbiyan/.cpan/sources],
' Links ' => q[/usr/bin/links],
' Make ' => q[/usr/bin/make],
' Make_arg ' => q[],
' Make_install_arg ' => q[],
' Makepl_arg ' => q[],
' NcFTP ' => q[],
' Ncftpget ' => q[],
' No_proxy ' => q[],
' Pager ' => q[/usr/bin/less],
' Prerequisites_policy ' => q[ask],
' Scan_cache ' => Q[atstart],
' Shell ' => Q[/bin/bash],
' Tar ' => Q[/bin/tar],
' Term_is_latin ' => q[1],
' Unzip ' => Q[/usr/bin/unzip],
' Urllist ' => [q[ftp://mirrors.ustc.edu.cn/cpan/]], #这块是重点, it's usually urlist not to be chosen.
' wget ' => q[/usr/bin/wget],
};
1;
__end__



Appendix:
Appendix 1. Common mistakes, this has not been tried, first put the!!!


The code is as follows
Make: * * No rule to make target ' yes '. Stop.
/usr/bin/make Yes-not OK
Running make Test
Can ' t test without successful make
Running make Install
Make had returned bad status, install seems impossible


There is a newspaper urlist did not choose, let Retry retry, then you need to first install the associated module, and then install it, or you retry countless times will not install.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.