How to resolve error when installing Perl CPAN modules?

6,943

Install the cpanminus script to get, unpack, build and install modules from CPAN.

  • sudo apt-get install cpanminus
  • cpan App::cpanminus

Now install the module GD::Graph with the following command:

  • cpanm GD::Graph

How to install CPAN modules

Share:
6,943

Related videos on Youtube

karthik.network
Author by

karthik.network

Updated on September 18, 2022

Comments

  • karthik.network
    karthik.network over 1 year

    I have installed the latest version of Perl CPAN on Ubuntu.

    When I try to install any CPAN module using the command perl -MCPAN -e shell;install GD::Graph, I am seeing the following error:

    
     **root@karthik#perl -MCPAN -e shell**
    
    ***Terminal does not support AddHistory.
    cpan shell -- CPAN exploration and modules installation (v1.9800)
    Enter 'h' for help.
    cpan[1]> install GD::Graph
    CPAN: Storable loaded ok (v2.20)
    Reading '/root/.cpan/sources/authors/01mailrc.txt.gz'
    CPAN: Compress::Zlib loaded ok (v2.02)
    ............................................................................DONE
    Reading '/root/.cpan/sources/modules/02packages.details.txt.gz'
      Database was generated on Fri, 29 Jun 2012 06:14:35 GMT
    CPAN: HTTP::Date loaded ok (v5.831)
    ............................................................................DONE
    Reading '/root/.cpan/sources/modules/03modlist.data.gz'
    Catching error: "'glob' trapped by operation mask at (eval 28) line 1.\cJ at /usr/share/perl/5.10/CPAN/Index.pm line 524\cJ\cICPAN::Index::rd_modlist('CPAN::Index', '/root/.cpan/sources/modules/03modlist.data.gz') called at /usr/share/perl/5.10/CPAN/Index.pm line 85\cJ\cICPAN::Index::reload('CPAN::Index') called at /usr/share/perl/5.10/CPAN.pm line 976\cJ\cICPAN::exists('CPAN=HASH(0x93dd658)', 'CPAN::Module', 'GD::Graph') called at /usr/share/perl/5.10/CPAN/Shell.pm line 1256\cJ\cICPAN::Shell::expandany('CPAN::Shell', 'GD::Graph') called at /usr/share/perl/5.10/CPAN/Shell.pm line 1681\cJ\cICPAN::Shell::rematein('CPAN::Shell', 'install', 'GD::Graph') called at /usr/share/perl/5.10/CPAN/Shell.pm line 1977\cJ\cICPAN::Shell::__ANON__('CPAN::Shell', 'GD::Graph') called at /usr/share/perl/5.10/CPAN.pm line 376\cJ\cIeval {...} called at /usr/share/perl/5.10/CPAN.pm line 373\cJ\cICPAN::shell() called at -e line 1\cJ" at /usr/share/perl/5.10/CPAN.pm line 392
            CPAN::shell() called at -e line 1
    Reading '/root/.cpan/sources/authors/01mailrc.txt.gz'
    ............................................................................DONE
    Reading '/root/.cpan/sources/modules/02packages.details.txt.gz'
      Database was generated on Fri, 29 Jun 2012 06:14:35 GMT
    ............................................................................DONE
    Reading '/root/.cpan/sources/modules/03modlist.data.gz'
    Terminal does not support GetHistory.
    Lockfile removed.
    'glob' trapped by operation mask at (eval 30) line 1.
     at /usr/share/perl/5.10/CPAN/Index.pm line 524
            CPAN::Index::rd_modlist('CPAN::Index', '/root/.cpan/sources/modules/03modlist.data.gz') called at /usr/share/perl/5.10/CPAN/Index.pm line 85
            CPAN::Index::reload('CPAN::Index') called at /usr/share/perl/5.10/CPAN.pm line 693
            CPAN::all_objects('CPAN=HASH(0x93dd658)', 'CPAN::Distribution') called at /usr/share/perl/5.10/CPAN/Shell.pm line 1044
            CPAN::Shell::failed('CPAN::Shell', 1, 1) called at /usr/share/perl/5.10/CPAN.pm line 414
            eval {...} called at /usr/share/perl/5.10/CPAN.pm line 414
            CPAN::shell() called at -e line 1***
    
    

    How can I resolve this?

  • koni_raid
    koni_raid almost 12 years
    Good to hear it worked!