如何在没有Internet连接的机器上安装Perl模块? [英] How do I install Perl modules on machines without an Internet connection?

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

问题描述

我需要在没有连接到互联网的网络机器上安装基于Perl的软件。因此,我想下载特定版本和/或最新版本的Perl模块,我也想知道这些模块是否需要安装程序。

I need to install my Perl-based software on networked machines which aren't connected to the internet. Therefore, I would like to download specific versions and/or latest versions of the Perl modules and I would also like to know if there is an install procedure required for these modules.

背景:

出于安全考虑,这些机器未连接到互联网,也被认为不必要。

Background:
The machines aren't connected to the internet for security reasons and its deemed unnecessary also.

我将下载的模块放在我称为安装服务器的机器上,它包含我的基于Perl的软件,并且还包含Perl模块的本地副本。

I would place the downloaded modules on a machine that I call the 'install server' and it contains my Perl based software and would also contain the local copies of the Perl modules.

我打电话给我要安装我的基于Perl的软件,目标机器,也没有连接到互联网。可以有几个目标机器,每个都可以运行我想要安装的软件。我登录到目标机器并运行一个安装脚本,该脚本将通过本地网络连接到安装机器,以获取基于Perl的软件和依赖的Perl模块并安装它们。

I call a machine that I want to install my Perl-based software on, the 'target machine', also not connected to the internet. There can be several target machines, each can run this software that I want to install. I log onto the target machine and run an install script which would connect to the install machine via the local network to obtain the Perl-based software and dependent Perl modules and installs them.

所以我需要知道:


  1. 如何/在哪里获取特定版本的Perl模块,例如CGI.pm等

  2. 如何安装这些Perl模块。是否只是将它们放在某个目录中,例如一个库路径,并确保该目录路径位于@INC库路径环境变量(如果还没有)?

I在安装模块时,不希望像做安装一样做任何事情。我希望模块可以根据需要进行预编译或准备,所以尽可能简单地安装它们。我想避免其他依赖关系,如make及其配置,并且必须解析其输出以检查它是否成功。

I would prefer not to have to do anything like make install etc. as part of installing the modules. I would like to modules to be pre-compiled or prepared as necessary so it is as simple as possible to install them. I want to avoid additional dependencies like make and its configuration, and having to parse its output to check whether it was successful.

请帮助我通过询问上述具体问题我不能改变没有连接到互联网的安装机器和目标机器的概念 - 我必须提供一个在这个安排中工作的解决方案。

Please help me by asking the above specific questions as I am not able to change the concept of 'install machine' and 'target machine' which aren't connected to the internet - I have to provide a solution that works within this arrangement.

推荐答案

通常的方式来解决我想从CPAN安装东西但没有网络的问题是使用大卫·多洛德(David Dorward)在答案中写道。但是,由于您进一步说了一句话,所以说你根本不想在客户机(目标)机器上进行任何真正的安装,如果可能的话,你想使用预编译的模块,我敦促你查看 PAR ,具体 PAR :: Repository (服务器)和 PAR :: Repository ::客户端

The usual way to solve "I want to install stuff from CPAN but without network" problems is to use a minicpan as David Dorward wrote in his answer. But since you're going one step further, saying that you'd rather not do any real installation on the client (target) machines at all, and that you want to use precompiled modules if possible, I urge you to check out PAR and specifically PAR::Repository (server) and PAR::Repository::Client.

由于这种方法需要一些研究才能加快速度,所以我不会建议我只需要Foo.pm像问题一旦你谈到了少数依赖关系和至少少数客户,那么它就成为一个更合适的解决方案。

Since this approach needs some research before you're up to speed, I wouldn't suggest it for "I just need Foo.pm" like problems. Once you're talking about a handful of dependencies and at least a handful of clients, then it becomes a more appropriate solution.

有关它的工作原理,请查看在YAPC ::欧洲2008年的演讲中,点击了幻灯片。它还提示了解决方案在客户端上提供PAR :: Repository :: Client模块的引导问题(提示:PAR可以生成独立的可执行文件)。

For an outline of how it works, check out the slides of my talk at YAPC::EU 2008. It also hints at solutions to the bootstrapping problem of making the PAR::Repository::Client module available on the clients (hint: PAR can generate self-contained executables).

这篇关于如何在没有Internet连接的机器上安装Perl模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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