CPAN 'crashing' on Ubuntu 12.04 - perl

I am trying to install perl modules using CPAN but CPAN seems to be crashing. It says there is an update that I can install (I'm running v1.960001) but after trying to run, it exits back to the command prompt:
cpan[1]> install CPAN
Going to read '/home/ubuntu/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Going to read '/home/ubuntu/.cpan/sources/modules/02packages.details.txt.gz'
Database was generated on Tue, 04 Jun 2013 14:08:21 GMT
..............
New CPAN.pm version (v2.00) available.
[Currently running version is v1.960001]
You might want to try
install CPAN
reload cpan
to both upgrade CPAN.pm and run the new version without leaving
the current session.
..............................................
ubuntu#ip-10-166-105-207:/home/www/cgi-bin$ sudo cpan
Terminal does not support AddHistory.
There seems to be running another CPAN process (pid 10592). Contacting...
Other job not responding. Shall I overwrite the lockfile '/home/ubuntu/.cpan/.lock'? (Y/n) [y]
When I try to get back into CPAN, it says that it's already running.
This happens when I try to update CPAN or install modules (like JSON).
Does anyone have any clues what might be going wrong?

I had the exact same problem on 14.04, and fixed it by adding a swapfile on the system, using the instructions located at: https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

Related

Can't install some POE perl module in Strawberry Perl

I've inherited a Perl project that uses a number of Perl modules. I've been trying to set up the environment, but it's been a nightmare. I'm now on day two of just trying to install the modules. The developer who's handing this off said he was able to install everything in about half an hour, and he never saw any of these problems.
My Environment:
Windows 10 Enterprise 20H2
Intel(R) Core(TM) i7-10850H CPU # 2.70GHz
32GB
64 bit
Strawberry Perl revision 5 version 32 subversion 1
Using CPAN Client, I've been able to install a number of modules without any issue. CPAN::Author, Test::MockObject, pp, Tk, Archive::Any, and a few others all just worked. However, POE has been a disaster.
Most times, I get stuck with a "can't move" failure:
cpan[1]> install POE
Database was generated on Tue, 26 Jul 2022 14:02:23 GMT
Running install for module 'POE'
Checksum for C:\strawberry\cpan\sources\authors\id\B\BI\BINGOS\POE-1.370.tar.gz ok
Scanning cache C:\strawberry\cpan\build for sizes
............................................................................DONE
Couldn't move C:\strawberry\cpan\build\tmp-12468\POE-1.370\lib to C:\strawberry\cpan\build\POE-1.370-0\lib: No such file or directory; #82295? CPAN::VERSION=2.28; File::Copy::VERSION=2.34; C:\strawberry\cpan\build\tmp-12468\POE-1.370\lib exists; C:\strawberry\cpan\build\POE-1.370-0\lib does not exist; cwd=C:/strawberry/cpan/build/tmp-12468;
I've run cpan from the command line, I've run the CPAN Client, I've run both variations as administrator, and nothing seems to work.
I've tried the "copy-hacked.pm" fix described at https://rt.cpan.org/Public/Bug/Display.html?id=82295
On some occasions, after blowing away all CPAN\BUILD\POE* directories, tmp* directories and POE*.yml files, rebooting, and running CPAN Client as administrator, I have actually gotten it (sometimes) to actually start installing/building, but then it gets stuck at "t/10_units/04_drivers/01_sysrw.t................1/17", where it sits for over an hour before we kill it.
I've tried copying the CPAN\build\POE*.* directories and POE*.yml files from the other developer, and run reload index/reload cpan, but that doesn't work, either.
Everyone else is just saying "it works for me", which doesn't really help.
Does anyone have any idea how I can force an installation of POE? Unfortunately, everything I'm finding online just says "all you have to to is run CPAN POE", so there's not much beyond that.
Needless to say, "debug perl installation process" wasn't part of the handoff plan, but right now we have no idea how to proceed.
Any help would be appreciated.

How to install a missing Perl module (Net/SFTP.pm)?

I am trying to install some missing Perl modules because when I run my Perl script I am getting the error:
Can't locate Net/SFTP.pm in #INC (you may need to install the Net::SFTP module)
The first step I have taken to install this is:
I have brought up CPAN in CMD and run the command cpan> install foo but no luck because after I run the command I am getting:
Fetching with LWP:
http://cpan.strawberryperl.com/authors/01mailrc.txt.gz
I am on a proxy so I am wondering if there is a way round the proxy?
Another step I have taken is that I have installed strawberry Perl from http://strawberryperl.com/ but still no luck.
Lastly, I have the file 01mailrc.txt.gz locally install in my download folder but not sure how to install it.
FYI: I am on Windows. I have not used Perl before. The Perl version I use is:
This is Perl 5, version 26, subversion 1 (v5.26.1) built for MSWin32-x64-multi-thread
Could someone help me on this or show me a way around on how to install it?

cpan getting killed when installing Log::Log4perl

I'm trying to install the perl module Log::Log4perl on a basic Digital Ocean server through Ubuntu as a backup tool I'm trying to use depends on it but it keeps saying "Killed". Could anyone with experience with cpan provide some guidiance on where I can find a log file telling me what the problem is?
$ cpan Log::Log4perl
Reading '/root/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Reading '/root/.cpan/sources/modules/02packages.details.txt.gz'
Database was generated on Sat, 27 Jun 2015 12:17:02 GMT
HTTP::Date not available
..............
New CPAN.pm version (v2.10) available.
[Currently running version is v2.00]
You might want to try
install CPAN
reload cpan
to both upgrade CPAN.pm and run the new version without leaving
the current session.
............Killed
It appears that this is a resource issue and it looks like other people have had similar issues with this as well. At the point in the run that you're showing, CPAN is trying to slurp that entire 02packages.details.txt.gz file into memory which is causing your OS to kill the process.
Take a look at this answer for instructions on how to use cpanm, or you could try downloading the module as a gz and run perl Makefile.PL && make && make install.
You are most likely running out of memory. I have had this issue when using a VM with 1GB of RAM and adding some swap space fixes the problem.

CPAN 1.61 has issue with embedded space in path within Cygwin on Win7

I’m a mere mortal using Cygwin on Win7 and wanting to develop perl scripts using SOAP::lite. Installation instructions I found at soaplite.com directed me to start with perl –MCPAN –e shell before attempting an > install SOAP::lite
The newb in me didn’t appreciate that my windows user profile has a space character in it and the CPAN set-up seemed to go all horribly wrong around the point where the script was writing make files for local::lib, MYMETA.yml and MYYMETA.json. I got “no such file or directory” messages quoting only the portion of the path that followed the space in my user profile.
$ uname -a
CYGWIN_NT-6.1 UKLHRL00020 2.0.4(0.287/5/3) 2015-06-09 12:22 x86_64 Cygwin
$ cpan --version
Loading internal null logger. Install Log::Log4perl for logging messages
/usr/bin/cpan version 1.61 calling Getopt::Std::getopts (version 1.06 [paranoid]),
running under Perl version 5.14.4.
[Now continuing due to backward compatibility and excessive paranoia.
See ``perldoc Getopt::Std'' about $Getopt::Std::STANDARD_HELP_VERSION.]
Nothing to install!
When I ran perl –MCPAN –e shell for the first time, it did report “Warning: You do not have write permission for Perl library directories.” and I elected for the default option [local::lib] for the approach to be taken.
So what can I do next?
Looking closer at the Cygwin’s setup-x86_64.exe, a search for “cpan” lists eight packages under the perl category for perl-CPAN-* and perl-Parse-CPAN*, which are all set to “Skip”. The package perl-CPANMeta: Perl distribution CPAN-Meta is version 2.150001-1 from cygwin.mirrors.pair.com. Since this is not installed yet, but the installed Perl5 has some knowledge of an old CPAN, I need to know if it is safe to install the latest and will it work with a space in my profile? Do I need to remove the old CPAN, and how?
You probably want to update to the latest version of ExtUtils::MakeMaker, recent versions contain various fixes for paths containing spaces. This should fix these issues.

Date::Manip Not Installing

I keep getting error messages when trying to install the Date::Manip module. Any Perl experts know what I can try?
The command I'm trying is
perl -MCPAN -e "install Date::Manip"
Perl version is 5.20 and the version of the Date::Manip it keeps trying to install is 6.45, but it comes back with "Make had some problems" and "No such file in archive". It does prompt me to manually install the file, but i have no clue on how to do that. Here's what it says...
Could not find file 'sulbeck#heather.osg.ufl.edu.2024:1399465428' in memory at C:\Strawberry\perl\lib/CPAN/Tarzip.pm line 408.
Making symbolic link 'C:\STRAWB~1\cpan\build\tmp-3576\Date-Manip6.45\lib\Date\Manip\.#Changes6.pod' to 'sulbeck#heather.osg.ufl.edu.2024:1399465428' failed at C:\Strawberry\perl\lib/CPAN/Tarzip.pm line 408.
Could not untar with Archive::Tar SBECK/Date-Manip-6.45.tar.gz
Had problems unarchiving. please build manually. Stopping: 'install' failed for 'Date:Manip
I had exactly the same problem today.
I've been able to get 6.44 installed by doing the following from within the cpan cli (you can access this by simply typing cpan in your terminal).
The developer for Date::Manip has archived previous versions of the module, you'll need to add the backpan URL into your cpan config so you can search for it.
o conf urllist push http://backpan.perl.org/
Now you should be able to install using a direct path to version 6.44
install SBECK/Date-Manip-6.44.tar.gz
I had to accept that the checksum wasn't present in the package, but after that the module seemed to install correctly.
I suspect you'll want to keep an eye on the module and this bug report so that you can upgrade once it has been fixed.
perl -MCPAN -e "install 'SBECK/Date-Manip-6.44.tar.gz'"
or wait until the distribution is fixed. '.#Changes6.pod' is an illegal filename for your tar.