如何在 Ubuntu 上安装 Net::SFTP 模块?

发布于 2024-08-07 00:10:42 字数 100 浏览 4 评论 0原文

我是 Perl 新手。如何安装 Net::SFTP 模块?我正在运行 Ubuntu Linux。我相信有一种简单的方法可以从命令行执行此操作,例如调用 $ cpan install 等。

I'm new to Perl. How do you install the Net::SFTP module? I'm running Ubuntu Linux. I believe there's a simple way to do it from the command line, like by calling $ cpan install or something.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

追风人 2024-08-14 00:10:42

一般来说,安装 perl 模块的命令行方法是:

perl -MCPAN -e "install Net::SFTP"

在某些情况下,最好从特定发行版附带的软件包或端口或其他类似系统安装 perl 模块。因为某些 Perl 模块使用编译的 C 代码,并且 C 代码编译和依赖关系可能会有所不同。例如,我的大多数服务器都使用 OpenBSD,如果给定版本的操作系统有软件包,我通常会使用在软件包中找到的版本,如果软件包中没有,我认为可以安全地使用它。从 CPAN 安装它,这通常对我有用。

Generally the command-line way to install perl modules is:

perl -MCPAN -e "install Net::SFTP"

There are instances where it is better to install perl modules from the packages or ports or other similar systems which come with a particular distribution. Because some Perl modules make use of compiled C code, and C code compilation and dependencies can vary. For instance, I use OpenBSD for most of my servers and I generally use the version I find in the packages for a given version of the OS if there is one, and if there isn't one in the packages I assume it is safe to install it from CPAN and that generally works for me.

溺深海 2024-08-14 00:10:42

一个很常见的选项是使用您的发行版中的软件包,以及 apt-getaptitude(或您喜欢的任何图形工具)。

如果您的发行版未提供该软件包,您可以:

  • 首先,安装 cpan 命令(如果尚未安装),例如: apt-get install cpan
  • 并且,然后,使用 cpan 命令安装您的软件包:cpan -i Net:SFTP

    (请注意,它会问很多问题 - 比如它是否还应该安装所需的软件包)
  • 如果需要,您可以访问 cpan 命令的文档:< code>cpan -h 或 perldoc -F /usr/bin/cpan (可能需要 perl-doc 包)

An option that's quite common is to use the packages from your distribution, with apt-get or aptitude (or any graphical tool you like).

If that package is not provided by your distribution, you can :

  • First, install the cpan command, if not already installed, with something like : apt-get install cpan
  • And, then, use the cpan command to install your package : cpan -i Net:SFTP

    (Note it'll ask lots of questions -- like should it also install required packages)
  • If needed, you can access the documentation of the cpan command : cpan -h or perldoc -F /usr/bin/cpan (might require the perl-doc package)
筑梦 2024-08-14 00:10:42

Net::SFTP 曾经包含在 Debian/Ubuntu 存储库中,但在某些时候它被删除,因为它需要具有 Debian 不可接受的许可证的 pari 库。

另一种方法是使用 Net::SFTP::Foreign,可作为 libnet-sftp-foreign-perl (或者也可以从 CPAN 安装)。

Net::SFTP used to be included in Debian/Ubuntu repositories but at some point it was removed because it requires the pari library that has a license not acceptable for Debian.

An alternative is to use Net::SFTP::Foreign available as libnet-sftp-foreign-perl (or also installable from CPAN).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文