简体   繁体   English

安装没有sudo访问权限的perl模块

[英]Installing perl module without sudo access

The module in question is Geo::IP::PurePerl and this is what I'm doing: 有问题的模块是Geo :: IP :: PurePerl ,这就是我正在做的:

wget http://search.cpan.org/CPAN/authors/id/B/BO/BORISZ/Geo-IP-PurePerl-1.24.tar.gz
tar -zxf Geo-IP-PurePerl-1.24.tar.gz
cd Geo-IP-PurePerl-1.24
perl Makefile.PL
make
make test
sudo make install

However, I don't have sudo access and just make install results in the following error: 但是,我没有sudo访问权限,只是出现以下错误而make install结果:

[~/perl/Geo-IP-PurePerl-1.24]# make install
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ERROR: Can't create '/usr/bin'
Do not have write permissions on '/usr/bin'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 at -e line 1
make: *** [pure_site_install] Error 13

Is there any way to get around this? 有什么办法可以解决这个问题?

I doubt there is any way to install a Perl module to the native system installation of Perl. 我怀疑是否有任何方法可以将Perl模块安装到Perl的本机系统安装中。

In the past I have had to install a new, completely independent version of perl in a directory that I do have write permission over and then ensure that my .profile file links my path to that location. 过去,我不得不在我具有写权限的目录中安装新的完全独立版本的perl,然后确保我的.profile文件将我的路径链接到该位置。 Then whenever I call perl I'm accessing the local install area where I have full write access to. 然后,每当我打电话给perl时,我都会访问我具有完全写访问权的本地安装区域。

Try: 尝试:

perl Makefile.PL PREFIX=~/perllib

of course then you will have to add that path to your @INC include path... 当然,那么您将必须将该路径添加到@INC包含路径...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM