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

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

问题描述

我需要在未连接到 Internet 的联网机器上安装基于 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 库路径环境变量中(如果还没有)?

作为安装模块的一部分,我不想做任何诸如 make install 之类的事情.我想根据需要预编译或准备模块,以便安装它们尽可能简单.我想避免额外的依赖项,例如 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 安装东西但没有网络"问题的常用方法是使用 minicpan,正如 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 上的演讲的幻灯片::EU 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天全站免登陆