简体   繁体   中英

CPAN.pm change .gz path

I am trying to change the CPAN.pm to include the destination of .gz file in the CPAN.pm but as I don't have the "sudo" rights hence its denying my access.

My question is how to uninstall the CPAN if it's possible and install again.

Is there any other solution for such cases.

Following command doesn't work:

cpan o conf init

You can use user local configuration in ~/.cpan/CPAN/MyConfig.pm , put this inside :

$CPAN::Config = {
  'gzip' => q[/usr/bin/gzip]
};

1;

Adapt the gzip path if needed.

Do you mean that you want to change where CPAN.pm stores archive files after it downloads them? There's a setting called keep_sources_where :

% cpan
cpan[1]> o conf keep_source_where
    keep_source_where  [/Users/brian/.cpan/sources]
Type 'o conf' to view all configuration items


cpan[2]> o conf keep_source_where /some/other/dir
    keep_source_where  [/some/other/dir]
Please use 'o conf commit' to make the config permanent!

There are several other setting that you can look at and set. They are all listed in the CPAN documentation.

The answer is

perl -MCPAN -e shell

o conf gzip /usr/bin/gzip
o conf commit

Done..... Same for everything . No need to reinstall CPAN if you want only to change some configuration.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM