如何在 Ubuntu 上安装 Net::SFTP 模块?
我是 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
一般来说,安装 perl 模块的命令行方法是:
在某些情况下,最好从特定发行版附带的软件包或端口或其他类似系统安装 perl 模块。因为某些 Perl 模块使用编译的 C 代码,并且 C 代码编译和依赖关系可能会有所不同。例如,我的大多数服务器都使用 OpenBSD,如果给定版本的操作系统有软件包,我通常会使用在软件包中找到的版本,如果软件包中没有,我认为可以安全地使用它。从 CPAN 安装它,这通常对我有用。
Generally the command-line way to install perl modules is:
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.
一个很常见的选项是使用您的发行版中的软件包,以及
apt-get
或aptitude
(或您喜欢的任何图形工具)。如果您的发行版未提供该软件包,您可以:
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
oraptitude
(or any graphical tool you like).If that package is not provided by your distribution, you can :
cpan
command, if not already installed, with something like :apt-get install cpan
cpan
command to install your package :cpan -i Net:SFTP
(Note it'll ask lots of questions -- like should it also install required packages)
cpan
command :cpan -h
orperldoc -F /usr/bin/cpan
(might require theperl-doc
package)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).