Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get App::cpanminus to work?

Tags:

ubuntu

perl

cpan

I have just installed a fresh copy of ubuntu 10.10. I installed perl 5.12.2 following brian d foy's recommended outline and then installed cpanminus by invoking curl -L http://cpanmin.us | perl5.12.2 - --sudo App::cpanminus.

Now, cpan5.12.2 works fine, but whenever I try to install a module using cpanm5.12.2 it fails finding it. e.g.:

$ sudo cpanm5.12.2 -v File::Copy::Recursive
You have make /usr/bin/make
You have LWP 5.837
You have /bin/tar: tar (GNU tar) 1.23
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
You have /usr/bin/unzip
Searching File::Copy::Recursive on cpanmetadb ...
! Finding File::Copy::Recursive on cpanmetadb failed.
Searching File::Copy::Recursive on search.cpan.org ...
! Finding File::Copy::Recursive on search.cpan.org failed.
! Couldn't find module or a distribution File::Copy::Recursive
like image 526
David B Avatar asked Oct 17 '10 19:10

David B


People also ask

How do I know what cpan modules are installed?

Available commands are: l - List all installed modules m - Select a module q - Quit the program cmd? Sample outputs: Installed modules are: JavaScript::SpiderMonkey Log::Log4perl Perl cmd?

What is the difference between cpan and Cpanm?

The main difference between the two is that if you have Perl you should already have the cpan command. Whereas you won't have cpanm unless/until you install it.

How do I uninstall a Perl module?

Type cpanm --uninstall Module::Name (note the " m ") to uninstall the module with cpanminus.


2 Answers

You might try using perlbrew to install a custom perl intrepreter. Then you can activate your 5.12.2 version, install cpanm (no sudo required) and install your modules as a normal user eg. "$ cpanm My::Module"

By using this method, you get custom cpanm binaries tied to each specific perlbrew version. You have to install cpan modules for every perlbrew version, but you don't end up with binaries like "cpanm5.12.2" but rather "cpanm". Perlbrew takes care of setting up a perl-version-specific path, which is rather handy IMHO.

like image 51
Drew Taylor Avatar answered Oct 02 '22 13:10

Drew Taylor


I had the same problem. LWP uses $HTTP_PROXY rather than $http_proxy on my machine.

If you specify something for $http_proxy without the protocol (in my case, I was missing http:), it will complain but seems misleading as it doesn't actually find the missing packages.

like image 35
Steven Avatar answered Oct 02 '22 12:10

Steven