我正在尝试更改以CPAN.pm
在其中包含.gz
文件的目标,CPAN.pm
但由于我没有“sudo”权限,因此它拒绝了我的访问。
我的问题是如果可能的话如何卸载 CPAN 并重新安装。
这种情况有没有其他解决方案。
以下命令不起作用:
cpan o conf init
您可以在中使用用户本地配置~/.cpan/CPAN/MyConfig.pm
,将其放入:
$CPAN::Config = {
'gzip' => q[/usr/bin/gzip]
};
1;
如果需要,调整gzip
路径。
您的意思是要更改 CPAN.pm 在下载存档文件后存储它们的位置吗?有一个设置叫做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!
您可以查看和设置其他几个设置。它们都列在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.