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

Poisson
  • 1,543
  • 6
  • 23
  • 34
  • well, what are the permission for `/home/cyrine/.cpan`? check with `ls -Fal` do you have permission do do what is needed? – Fredrik Pihl Apr 13 '13 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. – user1937198 Apr 13 '13 at 21:49

1 Answers1

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.

Dave Sherohman
  • 45,363
  • 14
  • 64
  • 102