windows 如何在没有 Internet 连接的情况下在 ActivePerl 中安装包?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/219079/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I install package in ActivePerl without Internet connection?
提问by OJW
In ActivePerl, "ppm" installs a package from the Internet, "ppm install x.ppd" installs from a ppd file, but most CPAN packages are distributed as .tar.gz
在 ActivePerl 中,“ppm”从 Internet 安装包,“ppm install x.ppd”从 ppd 文件安装,但大多数 CPAN 包作为.tar.gz分发
How do you supply modules to a machine running ActivePerl that doesn't have an Internet connection? ("make" will probably not be available.)
您如何为没有 Internet 连接的运行 ActivePerl 的机器提供模块?(“make”可能不可用。)
Update: an Internet connection can be used to download files and transfer them to the machine with a USB key, etc.
更新:可使用 Internet 连接下载文件并使用 USB 密钥等将它们传输到机器。
回答by Pat
I am sure there is an easier way, but I just checked a ppd file and it is just an xml file ...
我确定有更简单的方法,但我只是检查了一个 ppd 文件,它只是一个 xml 文件......
So you should be able to do the following if you want to install manually on a pc with no connection:
因此,如果您想在没有连接的电脑上手动安装,您应该能够执行以下操作:
Open the file , ex
打开文件,例如
http://trouchelle.com/ppm/Acme-LOLCAT.ppd
and download the appropriate file pointed to in the CODEBASE tag, in this case:
并下载 CODEBASE 标记中指向的相应文件,在本例中:
http://trouchelle.com/ppm/MSWin32-x86-multi-thread-5.8/Acme-LOLCAT-0.0.4.zip
Put both file on the pc with no connection, CODEBASE HREF="xxx" should be pointing to the zip file (either by putting the file in the same relative subfolder or by fixing the href so it points to the zip file on your disk)
将两个文件都放在没有连接的电脑上,CODEBASE HREF="xxx" 应该指向 zip 文件(通过将文件放在同一个相对子文件夹中或通过修复 href 使其指向磁盘上的 zip 文件)
Install from the ppd using
从 ppd 安装使用
ppm install x.ppd
回答by Pat
回答by Schwern
I know it's not an answer to your question, but if possible consider using Strawberry Perl, a CPAN-friendly distribution of Perl for Windows. It has a tidy installer, ships with make, a compiler and a properly configured CPAN shell all ready to go.
我知道这不是您问题的答案,但如果可能,请考虑使用Strawberry Perl,这是适用于 Windows 的 Perl 的 CPAN 友好发行版。它有一个整洁的安装程序,附带 make,一个编译器和一个正确配置的 CPAN shell,一切就绪。
And then you can use something like minicpanto create an offline CPAN repository.
然后你可以使用类似minicpan 的东西来创建一个离线 CPAN 存储库。
Don't be a second class Perl citizen and have to wait for someone else to compile you a ppm, drink straight from the CPAN firehose!
不要成为二等 Perl 公民,而必须等待其他人为您编译 ppm,直接从 CPAN 消防软管中喝水!
回答by JB. With Monica.
Since this is a very frequent scenario, I complete the answers here :
由于这是一个非常常见的场景,我在这里完成了答案:
As far as ActivePerl 5.14 is concerned you can also download ".tar.gz" files for your platform, or download so-called ".ppmx" files (same format). Save the files and invoke the ppm installer later when offline :
就 ActivePerl 5.14 而言,您还可以为您的平台下载“.tar.gz”文件,或下载所谓的“.ppmx”文件(相同格式)。保存文件并稍后在离线时调用 ppm 安装程序:
ppm.bat install MIME-Lite-3.028.ppmx
回答by holli
You might be interested in A guide to installing modules for Win32. It's a bit outdated (it talks about the command-line ppm) but the principles remain the same.
您可能对安装 Win32 模块的指南感兴趣。它有点过时(它谈论的是命令行 ppm),但原理保持不变。