1

First time using CPAN trying to get module. Why can't i install?

cpan[9]> install GD::Graph
Running install for module 'GD::Graph'
Running make for R/RU/RUZ/GDGraph-1.48.tar.gz
Prepending blib/arch and blib/lib of 18 build dirs to PERL5LIB; for 'get'
  Has already been unwrapped into directory /root/.cpan/build/GDGraph-1.48-LBF9mR
Prepending blib/arch and blib/lib of 18 build dirs to PERL5LIB; for 'make'
  '/usr/bin/perl Makefile.PL INSTALLDIRS=site' returned status 512, won't make
Prepending blib/arch and blib/lib of 18 build dirs to PERL5LIB; for 'test'
Running make test
  Make had some problems, won't test
Running make install
  Make had some problems, won't install

After manual install i got this:

...
Installing /usr/local/share/man/man3/Graph::Matrix.3pm
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ERROR: Can't create '/usr/local/lib64/perl5/auto/Graph'
mkdir /usr/local/lib64/perl5: File exists at /usr/share/perl5/ExtUtils/Install.pm      line   483
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 at -e line 1
make: *** [pure_site_install] Error 17
7
  • Try installing it manually (tar xvzf GDGraph-1.48.tar.gz; cd foo; perl Makefile.PL; make; make test; make install;) and look at the error messages (which will probably tell you that a c library you are depending on is missing).
    – Quentin
    Commented Jul 1, 2014 at 15:21
  • @Quentin, thx. After manual install i got message in the updated post.
    – sliddy
    Commented Jul 1, 2014 at 15:40
  • @sliddy Did you try sudo make install? Commented Jul 1, 2014 at 15:46
  • If you're asking about two different problems, we'll need to see the error message of the first, either by forcing make (not install) or by setting cpan's build_dir_reuse to 0.
    – ikegami
    Commented Jul 1, 2014 at 15:52
  • @ElliottFrisch, i'm root, why i need sudo?
    – sliddy
    Commented Jul 1, 2014 at 15:58

2 Answers 2

3

You're trying to create dir Graph in /usr/local/lib64/perl5/auto, but you don't have permission to do so.

3
  • I'm root, how could i don't have permission to do that?
    – sliddy
    Commented Jul 1, 2014 at 15:57
  • 1
    A read-only mount? Well, it could be another error, such as the drive being full or /usr/local/lib64/perl5/auto/Graph already existing as something other than a directory. Much more likely that it's not running as root.
    – ikegami
    Commented Jul 1, 2014 at 16:02
  • 1
    As you said, its something other than a directory. Just renamed the perl5 file and everything passed fine.
    – sliddy
    Commented Jul 1, 2014 at 16:23
0

Another avenue to try is the Perl Package Manager.

  1. In windows, you search on Perl and it will list appropriate "programs"...

  2. Select the Perl Package Manager.

  3. Then inside the package manager, I search GD::Graph and it gives four choices.

  4. I installed GDGraph-XY.

  5. Then I did a "use GD::Graph;" inside a .pl and it ran fine.

5
  • 1
    But the paths in this question make it pretty clear that we're talking about Linux or Unix here.
    – Dave Cross
    Commented Jul 2, 2014 at 11:18
  • Perl Package Manager doesn't come with Linux or Unix installation? I would think the concept would be similar.
    – cromastro
    Commented Jul 2, 2014 at 14:07
  • PPM is part of ActivePerl. You'll get installed if that's what you're using. But very few people on Linux/Unix (and a decreasing number on Windows) use ActivePerl. A Linux distribution will have its own packaging facility (e.g. yum on Red Hat-based systems or apt on Debian-based systems) but they work really differently to PPM.
    – Dave Cross
    Commented Jul 2, 2014 at 15:18
  • Thanks Dave.. Curious... what do you see Windows Perl programmers using? Strawberry Perl?
    – cromastro
    Commented Jul 2, 2014 at 15:41
  • Yeah, Strawberry Perl seems very popular. Largely, I think, because it includes everything you need to get a CPAN toolchain running - thereby freeing people from relying on PPM.
    – Dave Cross
    Commented Jul 2, 2014 at 15:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.