Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does installing certain CPAN modules require root privilege?

Tags:

perl

cpan

I need to install some CPAN modules in a linux box which I do not have the root privilege.

The installation of Spreadsheet::WriteExcel goes quite smoothly. But the try to install File::Find::Rule failed with warning "you do not have permissions to install into ....." and hint "you may have to su to root to install the package"

I'm puzzled why some CPAN module installation require root privilege while there are others do not ? and If I really want to use the File::Find::Rule in that linux box , is there any work-around solution I can choose ?

thanks.

like image 376
Haiyuan Zhang Avatar asked Nov 28 '22 06:11

Haiyuan Zhang


2 Answers

Have you setup CPAN for that user to install into a directory you control?

If so, then you could be running in the differences amongst modules that use Extutils::MakeMaker (the oldest and most common build/install system), Module::Build, and Module::Install. They all have little quirks.

This is why local::lib was created. Once you have it installed and setup you shouldn't have to worry about it again (except for rogue modules that want to write things to specific places even though they have been told not to).

like image 161
Chas. Owens Avatar answered Dec 22 '22 10:12

Chas. Owens


Check out local::lib for installing to other locations.

like image 20
Alan Haggai Alavi Avatar answered Dec 22 '22 08:12

Alan Haggai Alavi