Bootstrap FreeKB - Perl (Scripting) - Install a module using cpan
Perl (Scripting) - Install a module using cpan

Updated:   |  Perl (Scripting) articles

cpan (this article) or cpanm can be used to install a Perl module.

Before installing a module, you may want to use the perldoc command to determine if the module is installed.

perldoc -l Net::SSH:Perl

 

Or this command.

perl -MNet::SSH::Perl -e 'print $INC{"Net/SSH/Perl.pm"}'

 

On a Red Hat Distribution (CentOS, Fedora, Red Hat), the dnf install or yum install command can be used to install cpan.

dnf install perl-CPAN

 

Start the cpan interactive prompt.

cpan

 

Then, use the install module_name (or force install) command to install a module. In this example, the SSH module is installed.

cpan> install Net::SSH::Perl

 

If the install fails, you can try with the force option.

cpan> force install Net::SSH::Perl

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 838e74 in the box below so that we can be sure you are a human.