2

I have a problem when i want to install CPAN module

I type cpan to install cpan , but i get this error :

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

How can I change these permissions?

2 Answers 2

2

Probably the CPAN directory is owned by root; you can check this by doing ls -l /home/cyrine/.cpan.

There are two ways of fixing this:

  1. If you have sudo access to the server, use that when installing and using CPAN.

  2. Delete or rename the entire /home/cyrine/.cpan directory (either mv ~/.cpan ~/.cpan-old, or rm -rf ~/.cpan).

2
  • Thank you, but when i do this : "mv ~/.cpan ~/.cpan-old" i have the same problemes with .cpan-old folder
    – Poisson
    Commented Apr 15, 2013 at 9:21
  • 1
    Is there a problem with ownership of your own home directory?
    – Jenny D
    Commented Apr 15, 2013 at 9:26
0

It appears that you have a permissions issue with your home directory. Maybe someone else installed Perl modules in your home directory, and therefore you don't own those folders?

If you can't resolve the underlying permissions issue, there are several approaches to installing Perl modules without root privileges. You could use these to install modules in another location that you do have permission to access.

Local::Lib allows you to maintain your own local library of Perl modules which you install in your home directory. It gives instructions for installing the module itself if you don't already have it.

Perlbrew is a very simple-to-use tool that allows you to maintain your own separate installation of Perl (and install modules) in your home directory.

If that isn't enough, browse through some of the previous questions on this issue for more.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.