为什么安装某些CPAN模块需要root特权? [英] Why does installing certain CPAN modules require root privilege?

查看:74
本文介绍了为什么安装某些CPAN模块需要root特权?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在没有root特权的linux框中安装一些CPAN模块。

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

Spreadsheet :: WriteExcel 进行得很顺利。但是尝试安装 File :: Find :: Rule 失败,并显示警告您没有权限安装到.....,并提示您可能必须su到root才能安装软件包

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"

我很困惑,为什么某些CPAN模块安装需要root特权,而有些则不需要?并且如果我真的想使用 File :: Find :: rule 在该Linux框中,有没有我可以选择的解决方法?

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 ?

谢谢。

推荐答案

您是否已设置 CPAN 以便该用户安装到您控制的目录中?

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

如果是这样,那么您可能会在使用 Extutils :: MakeMaker (最古老,最常见的构建/安装系统), Module :: Build Module :: Install 。他们都有一些怪癖。

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.

这就是为什么 local :: lib 已创建。一旦完成安装和设置,您就不必再为它担心(流氓模块除外,即使那些流氓模块即使不告诉他们也要写东西到特定的地方)。

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

这篇关于为什么安装某些CPAN模块需要root特权?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆