如何在没有 root 权限的情况下安装 Perl 模块? [英] How can I install Perl modules without root privileges?

查看:64
本文介绍了如何在没有 root 权限的情况下安装 Perl 模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一台没有 root 权限的 Linux 机器上.我想通过 CPAN 将一些包安装到我的主目录中,这样当我运行 Perl 时,它就能看到它.

I am on a Linux machine where I have no root privileges. I want to install some packages through CPAN into my home directory so that when I run Perl, it will be able to see it.

我运行了 cpan,它要求提供一些配置选项.它要求某个目录,它建议 ~/perl 用于非 root 用户".尽管如此,当我尝试安装软件包时,它在 make install 步骤失败,因为我没有对 /usr/lib/perl5/whatever 的写访问权限.

I ran cpan, which asked for some coniguration options. It asked for some directory, which it suggested ~/perl "for non-root users". Still, when I try to install a package, it fails at the make install step, because I don't have write access to /usr/lib/perl5/whatever.

如何配置 CPAN 以便我可以将软件包安装到我的主目录中?

How can I configure CPAN so that I can install packages into my home directory?

推荐答案

参见 local::lib.

安装后,您可以执行以下操作:

Once you have it installed, you can do:

perl -MCPAN -Mlocal::lib -e 'CPAN::install(LWP)'

这篇关于如何在没有 root 权限的情况下安装 Perl 模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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