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?
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:
If you have sudo access to the server, use that when installing and using CPAN.
Delete or rename the entire /home/cyrine/.cpan directory (either mv ~/.cpan ~/.cpan-old
, or rm -rf ~/.cpan
).
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.