在没有CPAN网络访问权限的机器上安装具有很多依赖性的Perl模块 [英] Install Perl modules with lots of dependencies on a machine without CPAN network access

查看:75
本文介绍了在没有CPAN网络访问权限的机器上安装具有很多依赖性的Perl模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Linux服务器上安装DateTime机器.不幸的是,这台Linux服务器具有一些受限制的网络访问策略,使我无法直接使用CPAN Shell来下载内容或安装cpanminus.更改访问策略是我无法控制的,因此我正在寻找解决方法.我也没有对该Linux服务器的root访问权.

I am trying to install the DateTime machine on a Linux server. Unfortunately, this Linux server has some restricted network access policy that prevents me from using the CPAN shell directly to download content, or installing cpanminus. Changing the access policy is beyond my control, so I am looking for a workaround. I also don't have root access to this Linux server.

但是,我可以将任何内容下载到我的工作的Window机器上,然后上传到此服务器上的文件共享中.因此,我开始一一拉低DateTime依赖项.我将下载一个模块,有时它将具有Makefile.PL,有时将具有Build.PL.然后,我将每个Build或Makefile重新建立到我的INSTALL_BASE的基础上,测试每个模块.我做了大约20个模块,并且树似乎扩展到了越来越小的类,而且看不到尽头...

I can, however, download anything to my work's Window machine, and upload to a file share on this server. So I started to pull down the DateTime dependencies one by one. I would download a module, sometime it will have Makefile.PL, sometime it will have Build.PL. I then rebase each Build or Makefile to my INSTALL_BASE, test each module. I did that for about 20 modules, and the trees seem to expand to ever smaller classes with no end in sight...

希望您能告诉我更好的方法.有没有办法我可以从具有DateTime依赖项的CPAN访问权限的计算机(即,我的Windows框)上启动下载,将其下载到一个巨型Perl程序包中,将其上传到Linux服务器,然后在该服务器上运行CPAN(无网络访问权限),以把东西放在正确的地方?谢谢.

I hope you can tell me a better way. Is there a way I can initiate a download from a machine with CPAN access (ie. my Windows box) of all the DateTime dependencies into one giant Perl package, upload it to the Linux server, and run CPAN there (without network access) to put things in the right place? Thanks.

推荐答案

到目前为止,最有效的方法是制作

The most efficient way by far is to make a minicpan, install cpanm on the linux machine and alias localcpanmsomething like this:

alias localcpanm='cpanm --mirror file:///Users/Shared/cpan/ --mirror-only'

我已经在长途旅行中使用此技术,并通过斑驳的网络访问获得了巨大的成功.

I have used this technique on long train journeys with patchy network access with great success.

这篇关于在没有CPAN网络访问权限的机器上安装具有很多依赖性的Perl模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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