Search code examples
perlcpan

Perl: cpan force install not working in single command


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?


Solution

  • 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.