Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perl: cpan force install not working in single command

Tags:

perl

cpan

I want to force install a perl module. When I do this, the installation succeeds:

cpan shell -- CPAN exploration and modules installation (v2.00)
Enter 'h' for help.

cpan[1]> force install Net::DNS::SEC

But when I do this, it fails:

root@ubuntu:~# cpan force install Net::DNS::SEC

Warning: Cannot install force, don't know what it is.
Try the command

    i /force/ 

...
...

Running make install
  make test had returned bad status, won't install without force    

I need to run the cpan force install in a single command. How do I proceed?

like image 767
Randomly Named User Avatar asked May 27 '16 11:05

Randomly Named User


People also ask

How do I install Perl modules in CPAN?

To install Perl modules using CPAN, you need to use the cpan command-line utility. You can either run cpan with arguments from the command-line interface, for example, to install a module (e.g Geo::IP) use the -i flag as shown.


2 Answers

Please try cpan -fi Net::DNS::SEC

What the flags mean:

  • f: Force the specified action, when it normally would have failed. Use this to install a module even if its tests fail. When you use this option, -i is not optional for installing a module when you need to force it.

  • i: Install the specified modules.

cpan -h would provide you more details.

like image 54
gaganso Avatar answered Oct 06 '22 00:10

gaganso


use the -f option

From man cpan:

-f Force the specified action, when it normally would have failed. Use this to install a module even if its tests fail. When you use this option, -i is not optional for installing a module when you need to force it:

               % cpan -f -i Module::Foo
like image 44
Paul L Avatar answered Oct 06 '22 02:10

Paul L