gpt4 book ai didi

perl - 如何手动安装 Redis perl 库,即离线。以及从哪里可以获取所有要安装的依赖项

转载 作者:可可西里 更新时间:2023-11-01 11:11:39 25 4
gpt4 key购买 nike

我正在尝试安装 check_redis 插件,为此我需要 redis perl 库,但我无法访问 CPAN 和互联网。所以有没有办法通过下载 zip 文件和所有依赖项来安装。我正在使用 nagios核。 Here is the plugin i am trying to install

最佳答案

因为我在工作中遇到了类似的问题,所以我碰巧就这个话题写了个人问答。在这里:

Q: How to install CPAN modules without Internet access?
A: 1. Install CPAN::Mini on the internet machine:
$ cpan CPAN::Mini
2. Find a CPAN mirror here: http://mirrors.cpan.org/#de
e.g. http://ftp.hosteurope.de/pub/CPAN/
3. on the internet machine:
$ minicpan -l /path/to/local/cpan/mirror -r http://ftp.hosteurope.de/pub/CPAN/
4. Copy /path/to/local/cpan/mirror to the non-internet machine (or mount it)
5. On the non-internet machine add the directory to CPAN's search path:
$ cpan
cpan shell -- CPAN exploration and modules installation (v1.xxxx)
cpan> o conf urllist unshift file:///path/to/local/cpan/mirror
cpan> o conf commit
commit: wrote /home/user/.cpan/CPAN/MyConfig.pm
6. Install as usual on the non-internet machine.

要更新您的 CPAN 镜像,请转到您的互联网机器并重复步骤 3 和 4。

引用资料:


一些注意事项

虽然 CPAN 说初始镜像只会占用大约 1 GB,但它需要大约 3.5 GB。我认为他们的文档在这方面已经过时了。

镜像最初将包含 CPAN 上所有 模块的最新版本。每次更新镜像时,都会下载当时的最新版本(将旧版本留在磁盘上),因此随着新版本的到来,镜像会随着每次更新增长

我更新了我的镜像三四次,现在它有 3.9 GB。

关于perl - 如何手动安装 Redis perl 库,即离线。以及从哪里可以获取所有要安装的依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44542634/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com