首页
登录 | 注册

CPAN的配置

1)配置文件:  /usr/lib/perl5/5.8.8/CPAN/Config.pm
如果第一次运行cpan命令
cpan提示进行交互的进行配置
当然我们根据自己的需要也可以手动的编辑此文件

贴一下自己的配置:

# This is CPAN.pm's systemwide configuration file. This file provides
# defaults for users, and the values can be 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[/root/.cpan/build],
  'cache_metadata' => q[1],
  'cpan_home' => q[/root/.cpan],
  'dontload_hash' => {  },
  'ftp' => q[/usr/kerberos/bin/ftp],
  'ftp_proxy' => q[],
  'getcwd' => q[cwd],
  'gpg' => q[/usr/bin/gpg],
  'gzip' => q[/usr/bin/gzip],
  'histfile' => q[/root/.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[/root/.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[http://cpan.modperl.cn/]],
  'wget' => q[/usr/bin/wget],
};
1;
__END__

2)如果需要重新配置CPAN,输入:
#cpan
进入cpan后,输入:
#CPAN>o conf init

重新配置后Config.pm如下:

$CPAN::Config = {
  'applypatch' => q[],
  'auto_commit' => q[0],
  'build_cache' => q[10],
  'build_dir' => q[/root/.cpan/build],
  'build_dir_reuse' => q[1],
  'build_requires_install_policy' => q[ask/yes],
  'bzip2' => q[/usr/bin/bzip2],
  'cache_metadata' => q[1],
  'check_sigs' => q[0],
  'colorize_output' => q[0],
  'commandnumber_in_prompt' => q[1],
  'cpan_home' => q[/root/.cpan],
  'curl' => q[/usr/bin/curl],
  'dontload_hash' => {  },
  'ftp' => q[/usr/kerberos/bin/ftp],
  'ftp_passive' => q[1],
  'ftp_proxy' => q[],
  'getcwd' => q[cwd],
  'gpg' => q[/usr/bin/gpg],
  'gzip' => q[/usr/bin/gzip],
  'histfile' => q[/root/.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[/root/.cpan/sources],
  'load_module_verbosity' => q[v],
  'lynx' => q[],
  'make' => q[/usr/bin/make],
  'make_arg' => q[],
  'make_install_arg' => q[],
  'make_install_make_command' => q[/usr/bin/make],
  'makepl_arg' => q[],
  'mbuild_arg' => q[],
  'mbuild_install_arg' => q[],
  'mbuild_install_build_command' => q[./Build],
  'mbuildpl_arg' => q[],
  'ncftp' => q[],
  'ncftpget' => q[],
  'no_proxy' => q[],
  'pager' => q[/usr/bin/less],
  'patch' => q[/usr/bin/patch],
  'prefer_installer' => q[MB],
  'prefs_dir' => q[/root/.cpan/prefs],
  'prerequisites_policy' => q[ask],
  'scan_cache' => q[atstart],
  'shell' => q[/bin/bash],
  'show_unparsable_versions' => q[0],
  'show_upload_date' => q[0],
  'show_zero_versions' => q[0],
  'tar' => q[/bin/tar],
  'tar_verbosity' => q[v],
  'term_is_latin' => q[1],
  'term_ornaments' => q[1],
  'test_report' => q[0],
  'unzip' => q[/usr/bin/unzip],
  'urllist' => [q[http://cpan.modperl.cn/]],
  'use_sqlite' => q[0],
  'wget' => q[/usr/bin/wget],
  'yaml_load_code' => q[0],
  'yaml_module' => q[YAML],
};
1;
__END__

3)安装perl组件出错:

/usr/bin/make — NOT OK
Running make test
Can’t test without successful make
Running make install
make had returned bad status, install seems impossible

一.可以尝试
#cpan
cpan>o conf make /usr/bin/make
cpan>o conf commit
cpan>exit
然后用perl命令再安装一下该组件,看能否成功。

二.原因也可能是默认缓存/root/.cpan中的数据损坏
rm -rf ~/.cpan
删除后在perl -MCPAN -e shell中执行reload index
然后执行install Bundle::CPAN
最后执行reload CPAN即可正常通过命令行install MODULES

转载自:http://blog.chinaunix.net/u2/76219/showart_1726615.html

相关文章

  • 1.安装pcre tar -zxvf pcre-7.8.tar.gz ./configure 2.安装Nginx tar -zxvf nginx-0.7.26.tar.gz ./configure --prefix=/usr/local/n ...
  • Java Web项目,Android和微信小程序的初始页面配置
    我们在Eclipse里开了Java Web项目之后,Run As Tomcat或者Apache服务器,本地运行,如果直接用http://localhost:8080访问项目,会发现浏览器会打开一个默认的页面. 每个Java Web工程的目录 ...
  • 说明: 介绍如何为cartographer ros的参数以及配置 Cartographer的ROS集成使用tf2,因此所有帧ID都应该只包含一个帧名(带下划线的小写),不包含前缀或斜杠. 有关常用坐标系,请参见REP 105. 话题名称在C ...
  • 一台云服务器:CentOS 7 多个一级域名 开发测试过程中,因为某些原因,想要让手头的A.B域名同时指向云服务器的443端口,支持HTTPS. 安装Nginx [root]# wget https://nchc.dl.sourceforg ...
  •     对于RabbitMQ如果是简单的应用case,则用缺省配置即可,如果是复杂应用,则需要定制服务器配置.下面就开始详细配置之旅吧.    RabbitMQ通常有以下2种方式来定制Server:一.环境变量      环境变量初始值通过 ...
  • 网络数据包收发流程(二):不配置NAPI的情况
    上一篇讲的是内核配置成NAPI的情况,那也是绝大多数内核使用的配置现在讲讲内核不配置成NAPI时的情况一.no NAPI 数据结构不配置NAPI的时候,网络设备不使用自己的napi_struct结构,所有网络设备驱动都使用同一个napi_s ...

2020 unjeep.com webmaster#unjeep.com
12 q. 0.013 s.
京ICP备10005923号