安装CPAN模块 [英] install CPAN module

查看:229
本文介绍了安装CPAN模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想安装perl模块时遇到问题 我使"cpan"来安装cpan,但是我得到了这个"

I have a problem when i want to install perl module I make " cpan" to install cpan , but i get this "

终端不支持AddHistory.

Terminal does not support AddHistory.

您的配置建议CPAN.pm应该使用有效的

的目录 /home/cyrine/.cpan
不幸的是,我们无法创建锁定文件
/home/cyrine/.cpan/.lock
由于权限问题.

Your configuration suggests that CPAN.pm should use a working
directory of
/home/cyrine/.cpan
Unfortunately we could not create the lock file
/home/cyrine/.cpan/.lock
due to permission problems.

请确保配置变量 $ CPAN :: Config-> {cpan_home} 指向您可以在其中写入.lock文件的目录.你可以设定 您的CPAN/MyConfig.pm或CPAN/Config.pm中的此变量 @INC路径; 您似乎还没有用户配置(MyConfig.pm).

Please make sure that the configuration variable $CPAN::Config->{cpan_home} points to a directory where you can write a .lock file. You can set this variable in either a CPAN/MyConfig.pm or a CPAN/Config.pm in your @INC path; You don't seem to have a user configuration (MyConfig.pm) yet.

我设为"y" 然后我得到了这个奇怪的消息:

i make "y" then i got this strange message :

mkdir/home/cyrine/.cpan/CPAN:在/usr/share/perl/5.10/CPAN/Shell.pm>行656处拒绝的权限

mkdir /home/cyrine/.cpan/CPAN: Permission denied at /usr/share/perl/5.10/CPAN/Shell.pm >line 656

有什么主意吗? 谢谢

推荐答案

此问题的直接原因是您对/home/cyrine/.cpan没有写权限.以我的经验,这通常是由于以普通用户身份登录,然后在su会话中首次在该帐户上运行cpan导致的,导致在~cyrine中创建了CPAN配置(因为您具有cyrine的环境),但由root拥有(因为su已授予您root的权限).假设是这种情况,您应该可以通过su根目录解决此问题,运行命令chown -R cyrine.cyrine /home/cyrine/.cpan,然后以cyrine用户身份运行cpan.

The immediate cause of this problem is that you don't have write permissions on /home/cyrine/.cpan. In my experience, this is most often the result of logging in as a normal user, then running cpan for the first time on that account in a su session, causing the CPAN configuration to be created in ~cyrine (because you have cyrine's environment), but owned by root (because su has given you root's permissions). Assuming that is the case, you should be able to resolve this my suing to root, running the command chown -R cyrine.cyrine /home/cyrine/.cpan and then running cpan as user cyrine.

这篇关于安装CPAN模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆