简体   繁体   English

CPAN.pm更改.gz路径

[英]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. 我试图改变CPAN.pm包括的目的地.gz在文件CPAN.pm但我没有因此“命令”权利的否认我的访问。

My question is how to uninstall the CPAN if it's possible and install again. 我的问题是,如果可以的话,如何卸载CPAN并重新安装。

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/CPAN/MyConfig.pm使用用户本地配置,将其放入其中:

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

1;

Adapt the gzip path if needed. 根据需要调整gzip路径。

Do you mean that you want to change where CPAN.pm stores archive files after it downloads them? 您是否意味着要在CPAN.pm下载存档文件后更改其存储位置? There's a setting called keep_sources_where : 有一个名为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. 它们都在CPAN文档中列出。

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. 如果只想更改某些配置,则无需重新安装CPAN。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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