Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Problems installing Crypt:OpenPGP in local user area

by Popcorn Dave (Abbot)
on Apr 14, 2008 at 22:39 UTC ( [id://680389]=perlquestion: print w/replies, xml ) Need Help??

Popcorn Dave has asked for the wisdom of the Perl Monks concerning the following question:

Fellow monks,

I'm having problems installing Crypt::OpenPGP in my local space on my host and as of yet, they've unfortunately been less than helpful about solving the problem and coming from a windows background I'm completely lost about the error message I'm getting.

To start off, I installed a local CPAN shell as outlined by zaxo in Re: Creating my own CPAN directory which went successfully as I've been able to install some of the pre-requisites for the module without a problem. But when I try to use the CPAN shell to install Crypt::OpenPGP and let it fetch all the requisite additional modules I get the following:

/usr/bin/perl5.8.0 -Iinc Makefile.PL --config= --installdeps=Class::Er +rorHandler,0,Convert::ASN1,0.10,Crypt::DES_EDE3,0 *** Installing dependencies... *** You are not allowed to write to the directory '/home/wright/.cpan/ +sources'; the installation may fail due to insufficient permissions. ==> Should we try to install the required module(s) anyway? [n]

I would assume that I've got write permission since it's my space. The source directory's permissions are 755 so that shouldn't be an issue, and I set the prefix in the CPAN shell to point to my local directory before I tried to install the module.

Can anybody offer any insight as to what I might try or what I'm missing here?

Thanks in advance!


Revolution. Today, 3 O'Clock. Meet behind the monkey bars.

I would love to change the world, but they won't give me the source code

Replies are listed 'Best First'.
Re: Problems installing Crypt:OpenPGP in local user area
by jethro (Monsignor) on Apr 15, 2008 at 01:36 UTC
    First try touch /home/wright/.cpan/sources/xyz to make sure you really can create files there. If not, take a closer look at .cpan and .cpan/sources with "ls -al". Are you really the owner, is it maybe a symbolic link to somewhere you don't have write permissions to?

    You might use strace -f -o /tmp/xyz as a prefix to your cpan invocation. You'll then find in /tmp/xyz all system calls done by cpan and even if you don't know much about unix you probably can identify the specific system call that resulted in the warning message somewhere near the end of the file. Check the man-page for that call or post it here for an interpretation.

    Maybe the error message you got is wrong (bug in cpan or some installer!?), and it really is a full file system or a corrupted file system or a totally different directory that denies access. Try df /home/wright/.cpan/sources/ to check for space left on the partition it is in. This also shows you whether the dir is really in the file system you expect

      Thanks for the reply to both you and almut!

      Your first suggestion worked out just fine. No problems there at all. I was able to do 'touch xyz' and it created the file without a hitch. So I tried the strace and came back with a 25M file, of which I searched for a permissions issue and it came back with this:

      15290 open("/etc/shadow", O_RDONLY) = -1 EACCES (Permission denied +) 15290 stat64("/home/wright/.libnetrc", 0x8121b60) = -1 ENOENT (No such + file or directory) 15290 stat64("utils/Fcntl.pmc", 0xbfffd5e0) = -1 ENOENT (No such file +or directory) 15290 open("utils/Fcntl.pm", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No suc +h file or directory) 15290 stat64("/home/wright/lib/perl5/site_perl/5.8.4/i686-linux/Fcntl. +pmc", 0xbfffd5e0) = -1 ENOENT (No such file or directory) 15290 open("/home/wright/lib/perl5/site_perl/5.8.4/i686-linux/Fcntl.pm +", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) 15290 stat64("/home/wright/lib/perl­5/site_perl/5.8.4/Fcntl.pmc", 0xbf +ffd5e0) = -1 ENOENT (No such file or directory) 15290 open("/home/wright/lib/perl­5/site_perl/5.8.4/Fcntl.pm", O_RDONL +Y|O_LARGEFILE) = -1 ENOENT (No such file or directory) 15290 stat64("/usr/lib/perl5/5.8.0/i386-linux/Fcntl.pmc", 0xbfffd5e0) += -1 ENOENT (No such file or directory) 15290 open("/usr/lib/perl5/5.8.0/i386-linux/Fcntl.pm", O_RDONLY|O_LARG +EFILE) = 4 15290 ioctl(4, SNDCTL_TMR_TIMEBASE, 0xbfffd3e0) = -1 ENOTTY (Inappropr +iate ioctl for device) 15290 _llseek(4, 0, [0], SEEK_CUR) = 0 15290 brk(0x8499000) = 0x8499000 15290 read(4, "package Fcntl;\n\n=head1 NAME\n\nFcn"..., 4096) = 4096 15290 brk(0x849a000) = 0x849a000 15290 read(4, "SENFMT\t\t\n\t\t S_IFMT S_IMODE\n "..., 4096) = 102 +6 15290 brk(0x849b000) = 0x849b000 15290 brk(0x849c000) = 0x849c000 15290 brk(0x849d000) = 0x849d000 15290 brk(0x849e000) = 0x849e000 15290 brk(0x849f000) = 0x849f000 15290 read(4, "", 4096) = 0 15290 close(4) = 0 15290 brk(0x84a0000) = 0x84a0000 15290 stat64("/usr/lib/perl5/5.8.0/i386-linux/auto/Fcntl/Fcntl.so", {s +t_mode=S_IFREG|0555, st_size=11256, ...}) = 0 15290 stat64("/usr/lib/perl5/5.8.0/i386-linux/auto/Fcntl/Fcntl.bs", {s +t_mode=S_IFREG|0444, st_size=0, ...}) = 0 15290 open("/usr/lib/perl5/5.8.0/i386-linux/auto/Fcntl/Fcntl.so", O_RD +ONLY) = 4 15290 read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\260\t\0 +"..., 1024) = 1024 15290 fstat64(4, {st_mode=S_IFREG|0555, st_size=11256, ...}) = 0 15290 old_mmap(NULL, 14180, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = +0x2d6000 15290 mprotect(0x2d9000, 1892, PROT_NONE) = 0 15290 old_mmap(0x2d9000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_F +IXED, 4, 0x2000) = 0x2d9000 15290 close(4) = 0

      Hopefully I've provided enough of a snippet there that it makes sense to you, because unfortunately it's left me more confused than when I started. I would think that since the CPAN shell is running in my local directory it should be able to create the directories it needs or am I wrong in that?

      I've tried to even install some of the pre-requisites *before* trying Crypt::OpenPGP but when I then try to install the module, it seems to be saying that the pre-requisites that I've already (I thought) installed aren't there which makes no sense as they seem to have installed with no errors.

      Finally, the df command returned:

      Filesystem 1k-blocks Used Available Use% Mounted on /dev/hda1 198980892 129116736 69864156 65% /

      so I would think that I've got plenty of room to install all that I'm trying to do, don't I?


      Revolution. Today, 3 O'Clock. Meet behind the monkey bars.

      I would love to change the world, but they won't give me the source code

        Sorry for the late reply. Actually almut has the probable cause of your problems. Especially after all my suggestions turned up negative.

        EDIT: A step-by-step recipe of almuts solution:

        First find the installed ExtUtils::AutoInstall:

        locate ExtUtils/AutoInstall
        or
        find /usr/lib -name 'AutoInstall.pm' -print
        This will tell you the location of AutoInstall.pm, probably in /usr/lib/perl5/5.8.0/ExtUtils/

        Now copy the systemwide AutoInstall.pm to your homedir:

        mkdir ~/lib/perl5/site_perl/5.8.0/ExtUtils cp <pathtoautoinstall>/AutoInstall.pm ~/lib/perl5/site_perl/5.8.0/ExtU +tils
        Edit your copy of AutoInstall.pm. Find the line mentioned by almut (the one with Config{sitelib}) and change it to the newer version.

        That's it. You don't need to change PERL5LIB because you already did this when you installed cpan with Zaxos method.

Re: Problems installing Crypt:OpenPGP in local user area
by almut (Canon) on Apr 15, 2008 at 00:55 UTC

    Older versions of ExtUtils::AutoInstall had the following snippet of code

    sub _can_write { my $path = shift; mkdir ($path, 0755) unless -e $path; require Config; return 1 if -w $path and -w $Config::Config{sitelib}; print << "."; *** You are not allowed to write to the directory '$path'; the installation may fail due to insufficient permissions. . # ...

    while newer versions just test for -w $path, i.e.

    sub _can_write { my $path = shift; mkdir ($path, 0755) unless -e $path; return 1 if -w $path; # ...

    In other words, if $path isn't the problem, it could still be $Config::Config{sitelib}  (...something the error message doesn't say).

    Now I'm not entirely sure, but I suspect Config.pm might not be taking into account that you've told your CPAN shell to install to some other local directory...

    Anyhow, I would just try installing the current version of ExtUtils::AutoInstall into some local directory (and set PERL5LIB appropriately, or some such), and see if that works then. (If it doesn't - for some other reason - you could also copy the original (5.8.0) ExtUtils/AutoInstall.pm to some local directory, and edit the respective line to no longer test for Config{sitelib}.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://680389]
Approved by pc88mxer
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-04-23 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found