0

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

Terminal does not support AddHistory.

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.

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.

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

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

Any idea please? Thank you

2
  • well, what are the permission for /home/cyrine/.cpan? check with ls -Fal do you have permission do do what is needed? Commented Apr 13, 2013 at 21:46
  • 2
    Which linux disro is this (i am guessing Linux since the path is /home)? also are you trying to install modules on to system perl? If it is for system perl it is generally better to use the package manager. Commented Apr 13, 2013 at 21:49

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

3 Comments

Thank you for your reply. Can you please explain me in details the steps to resolve this problem. Best regards
cd /home/cyrine ; su -c chown -R cyrine.cyrine /home/cyrine/.cpan ; cpan
@Fredrik Pihl : drwxr-xr-x 5 root root 4096 2012-12-15 20:33 .cpan/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.