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?

mmmmmm
  • 32,227
  • 27
  • 88
  • 117
Poisson
  • 1,543
  • 6
  • 23
  • 34

2 Answers2

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).

Brad Gilbert
  • 33,846
  • 11
  • 78
  • 129
Jenny D
  • 1,225
  • 9
  • 20
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.

Community
  • 1
  • 1