Cpan (1) does not work with 'Can not allocate memory'

I get the following error: "I cannot allocate memory" when I try to install the Moose package for Perl.

Can anyone tell me what's wrong here?

ricky@rickyp :~$ sudo cpan install Moose Reading '/home/ricky/.cpan/Metadata' Database was generated on Wed, 29 Jul 2015 21:41:02 GMT Running install for module 'Moose' Running make for E/ET/ETHER/Moose-2.1405.tar.gz Checksum for /home/ricky/.cpan/sources/authors/id/E/ET/ETHER/Moose-2.1405.tar.gz ok Uncompressed /home/ricky/.cpan/sources/authors/id/E/ET/ETHER/Moose-2.1405.tar.gz successfully Using Tar:/bin/tar xf "Moose-2.1405.tar": Couldn't untar Moose-2.1405.tar: 'Cannot allocate memory' Package seems to come without Makefile.PL. (The test -f "/home/ricky/.cpan/build/ETHER-Al52av/Makefile.PL" returned false.) Writing one on our own (setting NAME to Moose) Had problems unarchiving. Please build manually Running make test Make had some problems, won't test Running make install Make had some problems, won't install ricky@rickyp :~$ 
+6
source share
4 answers

Responding, so that no longer goes unanswered. The OP solved its problem with cpanm .

If you are having trouble installing modules, cpanp may be another alternative to cpan that you can see.

+6
source

If you use cpan (1) in a system with limited memory, for example, in a lower-level hosting account, probably CPAN.pm cannot match the index of the module in memory or takes up most of the memory you have. CPAN storage is now huge, so what used to be a small index file is quite large. In fact, this is the most annoying part of the process for me, as it takes a lot of time to download and upload.

cpanminus (cpanm) does different things using the MetaCPAN API to find the information they need. It has a very small amount of memory.

Or you can run something else at the same time that you are taking up memory.

+3
source

I had the same issue recently on a drawer that didn't have a swap partition. Adding a small swap file (dd / dev / zero to the new file, mkswap in the swapon file) fixed the problem, even if cpan does not use any significant amount of memory or swap.

+1
source

I also faced the same thing. If you are using a virtual machine, increase the base memory [RAM]. The CPAN installation should work.

0
source

All Articles