问题描述
我想安装perl模块时遇到问题我使"cpan"来安装cpan,但是我得到了这个"
I have a problem when i want to install perl moduleI make " cpan" to install cpan , but i get this "
您的配置建议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 :
有什么主意吗?谢谢
推荐答案
此问题的直接原因是您对/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 su
ing to root, running the command chown -R cyrine.cyrine /home/cyrine/.cpan
and then running cpan
as user cyrine.
这篇关于安装CPAN模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!