Perl is an old and popular scripting language. Todays Python is preferred over Perl but there are a lot of useful tools used already by system administrators. There is generally a problem of dependency for Perl scripts. Here we will look at how to install required Perl modules into Linux.
Perl是一种古老而流行的脚本语言。 今天的Python比Perl更受青睐,但是系统管理员已经使用了许多有用的工具。 通常,Perl脚本存在依赖性问题。 在这里,我们将研究如何将所需的Perl模块安装到Linux中。
通过CPAN安装 (Install Via CPAN)
CPAN is a very good solution to install modules. It resolves and installs dependencies easily. CPAN is very easy to use versus installing modules manually.
CPAN是安装模块的非常好的解决方案。 它可以轻松解决并安装依赖项。 与手动安装模块相比,CPAN非常易于使用。
CentOS,Fedora,Red Hat (CentOS, Fedora, Red Hat)
We can install CPAN in rpm-based distributions like CentOS, Fedora and Red Hat like below.
我们可以将CPAN安装在基于rpm的发行版中,例如CentOS,Fedora和Red Hat,如下所示。
$ sudo yum install perl-CPAN.noarch
Ubuntu,Debian,Mint,Kali (Ubuntu, Debian, Mint, Kali)
We can use following command in order to install CPAN in deb based distributions like Debian, Ubuntu, Kali, and Mint.
我们可以使用以下命令来在基于Deb的发行版(如Debian,Ubuntu,Kali和Mint)中安装CPAN。
$ sudo apt-get install libpath-tiny-perl