5

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?

Randomly Named User
  • 1,889
  • 7
  • 27
  • 47

2 Answers2

15

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.

Community
  • 1
  • 1
gaganso
  • 2,914
  • 2
  • 26
  • 43
6

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
Paul L
  • 939
  • 4
  • 14