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

查看:68
本文介绍了如何在没有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用户".不过,当我尝试安装软件包时,由于我没有对/usr/lib/perl5/whatever的写访问权,因此在make install步骤中它失败了.

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?

推荐答案

请参见本地: :lib .

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

Once you have it installed, you can do:

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

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

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