Discussion:
cpan won't install any modules (mac os x 10.4.11)
(too old to reply)
Tom Smith
2009-11-11 16:06:47 UTC
Permalink
--001636e0b61e24a44c04781a9d4f
Content-Type: text/plain; charset=ISO-8859-1

Here's what happens:

-----------
$ sudo perl -MCPAN -e shell
Password:
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v1.9402)
Enter 'h' for help.

cpan[1]> install FileUtils::More
CPAN: Storable loaded ok (v2.20)
Going to read '/Users/me/.cpan/Metadata'
Database was generated on Sun, 01 Nov 2009 22:27:00 GMT
CPAN: Time::HiRes loaded ok (v1.9719)
LWP not available

Trying with "/usr/local/bin/curl -L -f -s -S --netrc-optional" to get
"
http://mirrors.cpan.org/showmirror.cgi?name=xmission.com/authors/01mailrc.txt.gz
"
CPAN: Compress::Zlib loaded ok (v2.02)
Error while trying to rename
'/Users/me/.cpan/sources/authors/01mailrc.txt.gz.tmp604' to
'/Users/me/.cpan/sources/authors/01mailrc.txt.gz': No such file or directory
LWP not available

Trying with "/usr/local/bin/curl -L -f -s -S --netrc-optional" to get
"
http://mirrors.cpan.org/showmirror.cgi?name=xmission.com/authors/01mailrc.txt.gz
"
Error while trying to rename
'/Users/me/.cpan/sources/authors/01mailrc.txt.gz.tmp604' to
'/Users/me/.cpan/sources/authors/01mailrc.txt.gz': No such file or
directoryTerminal does not support GetHistory.
Lockfile removed.

$
--------------



Here is my setup:

------
$ which perl
/usr/local/bin/perl

$ perl -v
This is perl, v5.10.1 (*) built for darwin-2level
Copyright 1987-2009, Larry Wall
<snip>

$ which cpan
/usr/local/bin/cpan

$ cpan -v
/usr/local/bin/cpan script version 1.9, CPAN.pm version 1.9402

$ sudo find / -type f -name CPAN.pm
/System/Library/Perl/5.8.6/CPAN.pm
/Users/me/.cpan/Bundle/CPAN.pm
/Users/me/my_tar_extractions/perl-5.10.1/lib/CPAN.pm
/usr/local/lib/perl5/5.10.1/CPAN.pm

$ perl -V
Summary of my perl5 (revision 5 version 10 subversion 1) configuration:

Platform:
osname=darwin, osvers=8.11.1, archname=darwin-2level
uname='darwin cws-computer.local 8.11.1 darwin kernel version 8.11.1:
wed oct 10 18:23:28 pdt 2007; root:xnu-792.25.20~1release_i386 i386 i386 '
config_args='-de'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-fno-common -DPERL_DARWIN -no-cpp-precomp
-fno-strict-aliasing -pipe -I/usr/local/include',
optimize='-O3',
cppflags='-no-cpp-precomp -fno-common -DPERL_DARWIN -no-cpp-precomp
-fno-strict-aliasing -pipe -I/usr/local/include'
ccversion='', gccversion='4.0.1 (Apple Computer, Inc. build 5370)',
gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /usr/lib
libs=-ldbm -ldl -lm -lc
perllibs=-ldl -lm -lc
libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup
-L/usr/local/lib'


Characteristics of this binary (from libperl):
Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP
USE_LARGE_FILES USE_PERLIO
Built under darwin
Compiled at Nov 5 2009 01:43:02
@INC:
/usr/local/lib/perl5/5.10.1/darwin-2level
/usr/local/lib/perl5/5.10.1
/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level
/usr/local/lib/perl5/site_perl/5.10.1
/usr/local/lib/perl5/site_perl/5.8.6
/usr/local/lib/perl5/site_perl
.

$ sudo find / -name LWP
Password:
/Library/Perl/5.8.6/darwin-thread-multi-2level/auto/LWP
/Library/Perl/5.8.6/LWP
/System/Library/Perl/5.8.6/CPAN/LWP
/Users/me/.cpan/build/libwww-perl-5.833-594ynR/blib/arch/auto/LWP
/Users/me/.cpan/build/libwww-perl-5.833-594ynR/blib/lib/auto/LWP
/Users/me/.cpan/build/libwww-perl-5.833-594ynR/blib/lib/LWP
/Users/me/.cpan/build/libwww-perl-5.833-594ynR/lib/LWP
/Users/me/.cpan/build/libwww-perl-5.833-KTAvI8/blib/arch/auto/LWP
/Users/me/.cpan/build/libwww-perl-5.833-KTAvI8/blib/lib/auto/LWP
/Users/me/.cpan/build/libwww-perl-5.833-KTAvI8/blib/lib/LWP
/Users/me/.cpan/build/libwww-perl-5.833-KTAvI8/lib/LWP
/Users/me/my_tar_extractions/libwww-perl-5.833/blib/arch/auto/LWP
/Users/me/my_tar_extractions/libwww-perl-5.833/blib/lib/auto/LWP
/Users/me/my_tar_extractions/libwww-perl-5.833/blib/lib/LWP
/Users/me/my_tar_extractions/libwww-perl-5.833/lib/LWP
/Users/me/my_tar_extractions/perl-5.10.1/lib/CPAN/LWP
/usr/local/lib/perl5/5.10.1/CPAN/LWP
-------


Can anyone diagnose the problem? Previously, I was using my system's perl
5.8.6, but I couldn't get cpan to install the first module I tried to
install, LWP::Simple. cpan could not complete its 'make test' for the
LWP::Simple install. So someone suggested that I install libwww-perl-5.833
by hand and skip the 'make test' step while installing. I did that, and
afterwards I was able to use LWP::Simple in a perl script. Next, I tried to
use cpan to install FileUtils::More, but that didn't work. As a result, I
decided to upgrade to perl 5.10.1 to see if that would cure the cpan
problems. After successfully installing perl 5.10.1, I tried to use cpan
to install FileUtils::More, but once again cpan couldn't install the module.

Thanks.
Andreas J. Koenig
2009-11-12 07:26:49 UTC
Permalink
Post by Tom Smith
Trying with "/usr/local/bin/curl -L -f -s -S --netrc-optional" to get
"
http://mirrors.cpan.org/showmirror.cgi?name=xmission.com/authors/01mailrc.txt.gz
"
The URL is bogus. You better start with 'o conf init urllist' and follow
the dialogue.

Verify any URL displayed, e.g.

lwp-request -Se 'http://mirrors.cpan.org/showmirror.cgi?name=xmission.com/authors/01mailrc.txt.gz'
--
andreas
7
2009-11-12 10:20:19 UTC
Permalink
--001636498f4becdc19047829e399
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Nov 12, 2009 at 12:26 AM, Andreas J. Koenig <
Post by Tom Smith
Post by Tom Smith
Trying with "/usr/local/bin/curl -L -f -s -S --netrc-optional" to get
"
http://mirrors.cpan.org/showmirror.cgi?name=xmission.com/authors/01mailrc.txt.gz
Post by Tom Smith
"
The URL is bogus. You better start with 'o conf init urllist' and follow
the dialogue.
Verify any URL displayed, e.g.
lwp-request -Se '
http://mirrors.cpan.org/showmirror.cgi?name=xmission.com/authors/01mailrc.txt.gz
'
--
andreas
Hi,

Thanks for the response.
Post by Tom Smith
Post by Tom Smith
You better start with 'o conf init urllist' and follow the dialogue.
That leads to an infinite loop:

$ sudo perl -MCPAN -e shell
Password:
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v1.9402)
Enter 'h' for help.

cpan[1]> o conf init urllist
You have no /Users/me/.cpan/sources/MIRRORED.BY
I'm trying to fetch one
CPAN: Time::HiRes loaded ok (v1.9719)
LWP not available

Trying with "/usr/local/bin/curl -L -f -s -S --netrc-optional" to get
"http://mirrors.cpan.org/showmirror.cgi?name=xmission.com/MIRRORED.BY"
You have an empty /Users/me/.cpan/sources/MIRRORED.BY,
I'm trying to fetch a better one
LWP not available

Trying with "/usr/local/bin/curl -L -f -s -S --netrc-optional" to get
"http://mirrors.cpan.org/showmirror.cgi?name=xmission.com/MIRRORED.BY"
You have an empty /Users/me/.cpan/sources/MIRRORED.BY,
I'm trying to fetch a better one
LWP not available

Trying with "/usr/local/bin/curl -L -f -s -S --netrc-optional" to get
"http://mirrors.cpan.org/showmirror.cgi?name=xmission.com/MIRRORED.BY"
You have an empty /Users/me/.cpan/sources/MIRRORED.BY,
I'm trying to fetch a better one
LWP not available


...and on and on for many pages of the exact same output until I hit
control-C.
Post by Tom Smith
Post by Tom Smith
Verify any URL displayed, e.g.
lwp-request -Se '
http://mirrors.cpan.org/showmirror.cgi?name=xmission.com/authors/01mailrc.txt.gz
'


Here is what I get:

$ lwp-request -Se '
http://mirrors.cpan.org/showmirror.cgi?name=xmission.com/authors/01mailrc.txt.gz
'
GET
http://mirrors.cpan.org/showmirror.cgi?name=xmission.com/authors/01mailrc.txt.gz-->
200 OK
Connection: close
Date: Thu, 12 Nov 2009 10:18:12 GMT
Server: Apache/1.3.27 (Unix) PHP/4.3.6 mod_perl/1.27
Content-Type: text/html; charset=utf-8
Client-Date: Thu, 12 Nov 2009 10:18:12 GMT
Client-Peer: 198.246.0.28:80
Client-Response-Num: 1
Client-Transfer-Encoding: chunked


What does that tell me?

Thanks.
7
2009-11-15 07:00:16 UTC
Permalink
Hi,

This interchange didn't make it onto the list.

==========
Gaurav Vaidya <***@ggvaidya.com>

Hi 7,
Post by Tom Smith
Trying with "/usr/local/bin/curl -L -f -s -S --netrc-optional" to get
"http://mirrors.cpan.org/showmirror.cgi?name=xmission.com/MIRRORED.BY"
You have an empty /Users/me/.cpan/sources/MIRRORED.BY,
I'm trying to fetch a better one
LWP not available
Try downloading MIRRORED.BY from http://www.cpan.org/MIRRORED.BY, and
save it into /Users/me/.cpan/sources.
===============


Yeah, I installed my first perl module with cpan: LWP::Simple it is.

Wow, it's as if I've been wandering around in the desert for a week, and
then I stumbled on two aborigine shaman who waved magic sticks over my head,
and all my troubles evaporated into the sky. Thanks!

I still can't install FileUtils::More, which I thought would be an easy
install, but that's because:

cpan[3]> install FileUtils::More
CPAN: Storable loaded ok (v2.20)
Going to read '/Users/me/.cpan/Metadata'
Database was generated on Sun, 01 Nov 2009 22:27:00 GMT
LWP not available

Trying with "/usr/local/bin/curl -L -f -s -S --netrc-optional" to get
"http://cpan.mirror.facebook.net/authors/01mailrc.txt.gz"
CPAN: Compress::Zlib loaded ok (v2.02)
Going to read '/Users/me/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
LWP not available

Trying with "/usr/local/bin/curl -L -f -s -S --netrc-optional" to get
"http://cpan.mirror.facebook.net/modules/02packages.details.txt.gz"
Going to read '/Users/me/.cpan/sources/modules/02packages.details.txt.gz'
Database was generated on Thu, 12 Nov 2009 05:27:30 GMT
HTTP::Date not available
............................................................................DONE
LWP not available

Trying with "/usr/local/bin/curl -L -f -s -S --netrc-optional" to get
"http://cpan.mirror.facebook.net/modules/03modlist.data.gz"
Going to read '/Users/me/.cpan/sources/modules/03modlist.data.gz'
............................................................................DONE
Going to write /Users/me/.cpan/Metadata
Warning: Cannot install FileUtils::More, don't know what it is.
Try the command

i /FileUtils::More/

to find objects with matching identifiers.

cpan[4]> i /FileUtils::More/
No objects found of any type for argument /FileUtils::More/

cpan[5]> i /FileUtils/
Module Dancer::FileUtils (SUKRIA/Dancer-0.9905.tar.gz)
Module VMS::Fileutils::Root (N/A)
Module VMS::Fileutils::SafeName (N/A)
3 items found

===================


In any case, for anyone else that has similar problems here are the steps I
went through:

I copy and pasted the MIRRORED.BY file at the link suggested:

http://www.cpan.org/MIRRORED.BY

I just pasted it into a text file and saved it to my Desktop with the name
MIRRORED.BY. Then before deleting the MIRRORED.BY file located at
/Users/me/.cpan/sources/MIRRORED.BY, I checked what was in it:

$ sudo cat ~/.cpan/sources/MIRRORED.BY (~ is a shortcut for /Users/you)


And sure enough it was empty, so I did this:

$ sudo rm ~/.cpan/sources/MIRRORED.BY


followed by:

$ mv ~/Desktop/MIRRORED.BY ~/.cpan/sources/MIRRORED.BY


Then I did:

$ sudo perl -MCPAN -e shell
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v1.9402)
Enter 'h' for help.


followed by:

cpan[1]> o conf init urllist



which then led me through a series of questions like this:

----
First, pick a nearby continent and country by typing in the number(s)
in front of the item(s) you want to select. You can pick several of
each, separated by spaces. Then, you will be presented with a list of
URLs of CPAN mirrors in the countries you selected, along with
previously selected URLs. Select some of those URLs, or just keep the
old list. Finally, you will be prompted for any extra URLs -- file:,
ftp:, or http: -- that host a CPAN mirror.

(1) Africa
(2) Asia
(3) Australasia
(4) Central America
(5) Europe
(6) North America
(7) Oceania
(8) South America
(9) (edit previous picks)
Select your continent (or several nearby continents) [9]
------

Note that you type in the number not the name of the continent.

Then I did:

cpan[2]> o conf commit
commit: wrote '/usr/local/lib/perl5/5.10.1/CPAN/Config.pm'

and finally:

cpan[7]> install LWP::Simple

<snip massive amounts of output>
7stud 7stud
2009-11-15 09:07:37 UTC
Permalink
--001485f1e64a6df7d004786539a0
Content-Type: text/plain; charset=ISO-8859-1

If anyone is wondering about what this mysterious line means:

$ sudo perl -MCPAN -e shell

Here is my basic understanding. This part:

perl -MCPAN -e shell

executes a perl program. The -e flag tells the perl command to execute the
line of code immediately following the -e flag. Here is an example:

$ perl -e 'print "hi\n";'

In that example, the outer quotes are necessary because on the command line
a space would terminate what the -e flag sees as its argument. Because perl
acolytes usually execute programs with use warnings, you can accomplish that
on the command line with the -w flag:

$ perl -w -e 'print "hi\n";'

Then if your single line of code after the -e flag has any errors in it,
they will be reported on the command line.

Therefore, this command:

$ perl -e shell

tells perl to execute the one line program that consists of the single line:
shell, which is a function call (in perl you don't always have to include
the parentheses like this: shell()).

This command:

$perl -MCPAN -e shell

uses the -M flag, and the -M flag tells the perl command to add the
following to the one line program (specified after the -e flag):

use CPAN;

which imports the CPAN module (yes, now the program has grown to two lines).
Importing the CPAN module allows the one line program to call functions
defined in the CPAN module. shell is a function defined in the CPAN module.

Finally, the leading sudo:

$ sudo perl -MCPAN -e shell

gives the program read/write/execute privileges of the administrator of your
computer, which is you if it's your computer. That allows the shell
function to install modules in system locations, like usr/local/bin, which a
program executing on your computer wouldn't normally have access to.
Loading...