DevTech101

DevTech101

The post below will show you how to generate the Config.pm
Then if you still need configuration changes (for example proxy) just modify the file by hand.

To initially configure perl cpan.

Make note of the config file & directory, for example below its /user/.cpan/CPAN/MyConfig.pm

perl -MCPAN -e shell
[..] snip
Would you like to configure as much as possible automatically? [yes]


Autoconfiguration complete.

commit: wrote '/user/.cpan/CPAN/MyConfig.pm'

You can re-run configuration any time with 'o conf init' in the CPAN shell

Now you can just modify the Config.pm by hand, for example to modify your proxy or any other changes.

An example Config.pm is below (note the user user was used as the user.

cat ~/.cpan/CPAN/MyConfig.pm
$CPAN::Config = {
  'applypatch' => q[],
  'auto_commit' => q[0],
  'build_cache' => q[100],
  'build_dir' => q[/user/.cpan/build],
  'build_dir_reuse' => q[0],
  'build_requires_install_policy' => q[yes],
  'bzip2' => q[/bin/bzip2],
  'cache_metadata' => q[1],
  'check_sigs' => q[0],
  'colorize_output' => q[0],
  'commandnumber_in_prompt' => q[1],
  'connect_to_internet_ok' => q[1],
  'cpan_home' => q[/user/.cpan],
  'ftp_passive' => q[1],
  'ftp_proxy' => q[],
  'getcwd' => q[cwd],
  'gpg' => q[/bin/gpg],
  'gzip' => q[/bin/gzip],
  'halt_on_failure' => q[0],
  'histfile' => q[/user/.cpan/histfile],
  'histsize' => q[100],
  'http_proxy' => q[http://proxy.domain.com:3120/],
  'inactivity_timeout' => q[0],
  'index_expire' => q[1],
  'inhibit_startup_message' => q[0],
  'keep_source_where' => q[/root/.cpan/sources],
  'load_module_verbosity' => q[none],
  'make' => q[/usr/gnu/bin/make],
  'make_arg' => q[],
  'make_install_arg' => q[],
  'make_install_make_command' => q[/usr/gnu/bin/make],
  'makepl_arg' => q[],
  'mbuild_arg' => q[],
  'mbuild_install_arg' => q[],
  'mbuild_install_build_command' => q[./Build],
  'mbuildpl_arg' => q[],
  'no_proxy' => q[],
  'pager' => q[/usr/bin/less -ins],
  'patch' => q[/usr/gnu/bin/patch],
  'perl5lib_verbosity' => q[none],
  'prefer_external_tar' => q[0],
  'prefer_installer' => q[MB],
  'prefs_dir' => q[/user/.cpan/prefs],
  'prerequisites_policy' => q[follow],
  'proxy_user' => q[],
  'recommends_policy' => q[1],
  'scan_cache' => q[atstart],
  'shell' => q[/usr/bin/bash],
  'show_unparsable_versions' => q[0],
  'show_upload_date' => q[0],
  'show_zero_versions' => q[0],
  'suggests_policy' => q[0],
  'tar' => q[/usr/gnu/bin/tar],
  'tar_verbosity' => q[none],
  'term_is_latin' => q[1],
  'term_ornaments' => q[1],
  'test_report' => q[0],
  'trust_test_report_history' => q[0],
  'unzip' => q[/bin/unzip],
  'urllist' => [q[http://www.cpan.org/]],
  'use_prompt_default' => q[0],
  'use_sqlite' => q[0],
  'version_timeout' => q[15],
  'wget' => q[/bin/wget],
  'yaml_load_code' => q[0],
  'yaml_module' => q[YAML],
};
1;
__END__

Now to install any module from commend line just run.

perl -MCPAN -e 'install XML::RSS'
...
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
%d bloggers like this: