Search code examples
perlunixcpanaix

CPAN shell runs out of memory. How can I give it more memory on Unix?


I'm getting an Out of memory! message for all installs. I've never used cpan before and I'm not really sure how it works. I did a ulimit on the /.cpan directory and it resulted in unlimited. Here's what I'm looking at:

[/usr/bin]# perl -MCPAN -e shell
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v1.7602)
ReadLine support available (try 'install Bundle::CPAN')

cpan> install Term::Readline
CPAN: Storable loaded ok
Going to read /.cpan/Metadata
Going to read /.cpan/sources/authors/01mailrc.txt.gz
Going to read /.cpan/sources/modules/02packages.details.txt.gz
  Database was generated on Tue, 19 Jun 2012 11:51:03 GMT
CPAN: HTTP::Date loaded ok

  There's a new CPAN.pm version (v1.9800) available!
  [Current version is v1.7602]
  You might want to try
    install Bundle::CPAN
    reload cpan
  without quitting the current session. It should be a seamless upgrade
  while we are running...

Out of memory!
Terminal does not support GetHistory.
Lockfile removed.

Solution

  • This is not about increasing memory, but maybe a solution for you.

    You can try use cpanm instead of cpan, so:

    This will install cpanm for you

    $ curl -L http://cpanmin.us | perl - --self-upgrade

    and after you can install modules e.g.:

    $ cpanm Task::Plack

    cpanm needs much less memory.