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

I premise that I have configured the makepl_arg configuration variable suitably (not that it particularly matters with this particular problem, I suppose) to use CPAN for installing some modules in my home directory on a system I'm allowed as a user but on which I don't have root privileges. At a certain point I get this:

*** ExtUtils::AutoInstall configuration finished. *** Installing dependencies... *** You are not allowed to write to the directory '/home/blazar/.cpan/ +sources'; the installation may fail due to insufficient permissions. sudo: error while loading shared libraries: liblber-2.2.so.7: cannot o +pen shared object file: No such file or directory ==> Should we try to install the required module(s) anyway? [n]

The permissions for /home/blazar/.cpan/sources are as follows:

$ ls -ld /home/blazar/.cpan/sources drwxr-xr-x 4 blazar users 4096 Oct 7 2004 /home/blazar/.cpan/sources

What's going on? How can I get around it? I see sudo(8) mentioned above. Why is it? I gather I'm installing as a user, in userland. May that be the problem?

Replies are listed 'Best First'.
Re: Problem installing module in my own home with CPAN.pm
by f00li5h (Chaplain) on Mar 29, 2007 at 09:22 UTC

    I'm not sure of the specifics, I just did as I was told.

    I'm not sure that I installed anything that links against anything though. I've only really used it for pure perl things thus far

    @_=qw; ask f00li5h to appear and remain for a moment of pretend better than a lifetime;;s;;@_[map hex,split'',B204316D8C2A4516DE];;y/05/os/&print;
Re: Problem installing module in my own home with CPAN.pm
by xdg (Monsignor) on Mar 29, 2007 at 11:47 UTC
    I see sudo(8) mentioned above.

    What command are you using to run CPAN.pm? And do you have sudo in your CPAN config file somewhere?

    Some people build and test modules as an ordinary user and then sudo for installing them. That's different than just building and installing into a personal library that you add to PERL5LIB. Which are you trying to do?

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

      What command are you using to run CPAN.pm?
      perl -MCPAN -eshell
      And do you have sudo in your CPAN config file somewhere?

      (/me is fairly sure to have already checked, but to be sure goes and controls...) nope!

      That's different than just building and installing into a personal library that you add to PERL5LIB. Which are you trying to do?

      The latter!

        Bingo! Check the docs for ExtUtils::AutoInstall:

        If you do not wish to put a copy of ExtUtils::AutoInstall under inc/, +and are confident that users will have internet access, you may repla +ce the use lib 'inc'; line with this block of code: # ExtUtils::AutoInstall Bootstrap Code, version 7. BEGIN{my$p='ExtUtils::AutoInstall';my$v=0.45;$p->VERSION||0>=$v or+eval"use $p $v;1"or+do{my$e=$ENV{PERL_EXTUTILS_AUTOINSTALL}; (!defined($e)||$e!~m/--(?:default|skip|testonly)/and-t STDIN or eval"use ExtUtils::MakeMaker;WriteMakefile(PREREQ_PM=>{'$p',$v} );1"and exit)and print"==> $p $v required. Install it from CP". "AN? [Y/n] "and<STDIN>!~/^n/i and print"*** Installing $p\n"and do{if (eval '$>' and lc(`sudo -V`) =~ /version/){system('sudo', $^X,"-MCPANPLUS","-e","CPANPLUS::install $p");eval"use $p $v;1" ||system('sudo', $^X, "-MCPAN", "-e", "CPAN::install $p")}eval{ require CPANPLUS;CPANPLUS::install$p};eval"use $p $v;1"or eval{ require CPAN;CPAN::install$p};eval"use $p $v;1"||die"*** Please manually install $p $v from cpan.org first...\n"}}}

        I really, really detest all the various autoinstallers.

        I'd report the use of AutoInstall as a bug for the module that is failing.

        -xdg

        Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Re: Problem installing module in my own home with CPAN.pm
by Herkum (Parson) on Mar 29, 2007 at 12:08 UTC

    It looks like that sudo or some other system command is trying to use OpenLdap from wait I saw in this email and it cannot find the library for it.

    I guess the question that needs to be asked, is where did the installation come from and how was it setup? If it was compiled to LDAP and then someone removed LDAP then that might be the root of your issue.

    All this is just a guess, take it for what it is... :)