Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Install Module with no admin permission

by avico78 (Novice)
on Jul 05, 2017 at 12:22 UTC ( #1194235=perlquestion: print w/replies, xml ) Need Help??

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

I'm running without root/admin permission on Linux illinXXXX 3.10.0-514.6.1.el7.x86_64 #1 SMP Sat Dec 10 11:15:38 EST 2016 x86_64 x86_64 x86_64 GNU/Linux Perl version:

xxxxx@illinxxxx~/perl5]$ perl -V /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 also.. perl -v This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-li +nux-thread-multi (with 28 registered patches, see perl -V for more detail)
I want to have the option to install Perl modules , following this guide : https://srcc.stanford.edu/farmshare2/software-perllocallib#useManually running:

[user@illinXXXX ~]$ perl -Mlocal::lib Attempting to create directory /testusers/env/test/user/perl5 test 1 == ${?PERL_LOCAL_LIB_ROOT} && setenv PERL_LOCAL_LIB_ROOT "${PER +L_LOCAL_LIB_ROOT}:/testusers/env/test/user/perl5" || setenv PERL_LOCA +L_LIB_ROOT "/testusers/env/test/user/perl5"; setenv PERL_MB_OPT "--install_base /testusers/env/test/user/perl5"; setenv PERL_MM_OPT "INSTALL_BASE=/testusers/env/test/user/perl5"; test 1 == ${?PERL5LIB} && setenv PERL5LIB "/testusers/env/test/user/pe +rl5/lib/perl5:${PERL5LIB}" || setenv PERL5LIB "/testusers/env/test/us +er/perl5/lib/perl5"; test 1 == ${?PATH} && setenv PATH "/testusers/env/test/user/perl5/bin: +${PATH}" || setenv PATH "/testusers/env/test/user/perl5/bin";

from the installation guide: "Attempting to create directory...is what's important ..." If you see that message, and no errors, then local::lib is ready to use!" I see perl5 directory created but nothing in it. I need Perl to work with Couchbase DB - mostly for reading and updating , Found this module: http://search.cpan.org/~norbu/Store-CouchDB-3.8/lib/Store/CouchDB.pm But when trying to install as:

perl -Mlocal::lib Makefile.PL following guide instruction : Warning: prerequisite Any::Moose 0 not found. Warning: prerequisite Data::Dump 0 not found. Warning: prerequisite Data::Printer 0 not found. Warning: prerequisite JSON 0 not found. Warning: prerequisite Types::Serialiser 0 not found. Writing Makefile for Store::CouchDB

secondly , I tried to install from cpan:

eval `perl -I$HOME/perl5/lib -Mlocal::lib=--shelltype=csh` [user@illinXXXX Store-CouchDB-3.8]$ eval `perl -I$HOME/perl5/lib -Mloc +al::lib=--shelltype=csh` Unknown import argument: --shelltype=csh at /usr/share/perl5/vendor_pe +rl/local/lib.pm line 47.

Your help is high appreciated </code>

Replies are listed 'Best First'.
Re: Install Module with no admin permission
by marto (Cardinal) on Jul 05, 2017 at 12:51 UTC

      Tnx,so if the local::lib is old one , how can i install a new one as private module where im not the admin? I tried to run the command and received:

      [XXXX@illinXXXX ~/perl5]$ cpan>o conf makepl_arg INSTALL_BASE=/testuse +rs/env/test/XXXX/perl5 --2017-07-05 16:52:24-- http://mirror.teklinks.com/CPAN/authors/01mai +lrc.txt.gz Resolving mirror.teklinks.com (mirror.teklinks.com)... failed: Name or + service not known. wget: unable to resolve host address ‘mirror.teklinks.com’ --2017-07-05 16:52:24-- ftp://mirrors.sonic.net/cpan/authors/01mailrc +.txt.gz => ‘/testusers/env/test/XXXX/.cpan/sources/authors/01mailrc +.txt.gz.tmp16670’ Resolving mirrors.sonic.net (mirrors.sonic.net)... failed: Name or ser +vice not known. wget: unable to resolve host address ‘mirrors.sonic.net’ --2017-07-05 16:52:24-- ftp://mirror.team-cymru.org/CPAN/authors/01ma +ilrc.txt.gz => ‘/testusers/env/test/XXXX/.cpan/sources/authors/01mailrc +.txt.gz.tmp16670’ Resolving mirror.team-cymru.org (mirror.team-cymru.org)... failed: Nam +e or service not known. wget: unable to resolve host address ‘mirror.team-cymru.org’ --2017-07-05 16:52:24-- http://mirror.teklinks.com/CPAN/authors/01mai +lrc.txt.gz Resolving mirror.teklinks.com (mirror.teklinks.com)... failed: Name or + service not known. wget: unable to resolve host address ‘mirror.teklinks.com’ --2017-07-05 16:52:24-- ftp://mirrors.sonic.net/cpan/authors/01mailrc +.txt.gz => ‘/testusers/env/test/XXXX/.cpan/sources/authors/01mailrc +.txt.gz.tmp16670’ Resolving mirrors.sonic.net (mirrors.sonic.net)... failed: Name or ser +vice not known. wget: unable to resolve host address ‘mirrors.sonic.net’ --2017-07-05 16:52:24-- ftp://mirror.team-cymru.org/CPAN/authors/01ma +ilrc.txt.gz => ‘/testusers/env/test/XXXX/.cpan/sources/authors/01mailrc +.txt.gz.tmp16670’ Resolving mirror.team-cymru.org (mirror.team-cymru.org)... failed: Nam +e or service not known. wget: unable to resolve host address ‘mirror.team-cymru.org’ --2017-07-05 16:52:24-- http://mirror.teklinks.com/CPAN/authors/01mai +lrc.txt.gz Resolving mirror.teklinks.com (mirror.teklinks.com)... failed: Name or + service not known. wget: unable to resolve host address ‘mirror.teklinks.com’ --2017-07-05 16:52:24-- http://mirror.teklinks.com/CPAN/authors/01mai +lrc.txt.gz Resolving mirror.teklinks.com (mirror.teklinks.com)... failed: Name or + service not known. wget: unable to resolve host address ‘mirror.teklinks.com’ --2017-07-05 16:52:24-- ftp://mirrors.sonic.net/cpan/authors/01mailrc +.txt.gz => ‘/testusers/env/test/XXXX/.cpan/sources/authors/01mailrc +.txt.gz.tmp16670’ Resolving mirrors.sonic.net (mirrors.sonic.net)... failed: Name or ser +vice not known. wget: unable to resolve host address ‘mirrors.sonic.net’ --2017-07-05 16:52:24-- ftp://mirror.team-cymru.org/CPAN/authors/01ma +ilrc.txt.gz => ‘/testusers/env/test/XXXX/.cpan/sources/authors/01mailrc +.txt.gz.tmp16670’ Resolving mirror.team-cymru.org (mirror.team-cymru.org)... failed: Nam +e or service not known. wget: unable to resolve host address ‘mirror.team-cymru.org’ --2017-07-05 16:52:24-- ftp://mirrors.sonic.net/cpan/authors/01mailrc +.txt.gz => ‘/testusers/env/test/XXXX/.cpan/sources/authors/01mailrc +.txt.gz.tmp16670’ Resolving mirrors.sonic.net (mirrors.sonic.net)... failed: Name or ser +vice not known. wget: unable to resolve host address ‘mirrors.sonic.net’ --2017-07-05 16:52:24-- ftp://mirror.team-cymru.org/CPAN/authors/01ma +ilrc.txt.gz => ‘/testusers/env/test/XXXX/.cpan/sources/authors/01mailrc +.txt.gz.tmp16670’ Resolving mirror.team-cymru.org (mirror.team-cymru.org)... failed: Nam +e or service not known. wget: unable to resolve host address ‘mirror.team-cymru.org’
        Resolving mirror.team-cymru.org (mirror.team-cymru.org)... failed: Nam +e or service not known. wget: unable to resolve host address ‘mirror. +team-cymru.org’

        Looks like a networking problem. Can you access this from the command line of the machine in question? If not then you need to speak to your sys/network admins. If you can you may still need their help to configure cpan, e.g. WORKING WITH CPAN.pm BEHIND FIREWALLS. FWIW cpanm has fewer dependancies. I work mainly offline using a cpan mirror created by minicpan, copied onto our clients network, with no internet access.

Re: Install Module with no admin permission
by Corion (Pope) on Jul 05, 2017 at 12:29 UTC

    The --shelltype option was introduced with local::lib 2.0.

    I guess a quick workaround could be to use a more bourne sh-compatible shell instead of csh.

    The somewhat longer approach would be to install a more recent local::lib, potentially from within that bourne shell.

      Tnx, Maybe i miss something .. I'm following this guide: https://srcc.stanford.edu/farmshare2/software-perllocallib#useManually is it not suppose to install the local::lib? case not, how can install it then? Need more details how to have the ability add modules to some private directory and use it where I'm not the admin. also download: local-lib-2.000023 Tried to install

      perl -Mlocal::lib Makefile.PL Warning: prerequisite ExtUtils::MakeMaker 7.00 not found. We have 6.68 +. Writing Makefile for local::lib [user@illinxxxx local-lib-2.000023]$ pwd /testusers/env/test/nadavp/perl5/local-lib-2.000023 also... [user@illinxxxx local-lib-2.000023]$ perl Makefile.PL Warning: prerequisite ExtUtils::MakeMaker 7.00 not found. We have 6.68 +. Writing Makefile for local::lib
      Please assist

        It seems that local::lib raised its minimum prerequisite version in 2014, for one reason or another.

        Either you patch their Makefile.PL to use any version of ExtUtils::MakeMaker or you try to install local::lib 2.000014 or earlier to work around this.

        Maybe you can also just copy the files of local::lib to their target destination, but I don't know where that should be.

        Maybe their bootstrapping technique works for you, even though their Makefile.PL really wants ExtUtils::MakeMaker v7.00. Hopefully just commenting out the line below PREREQ_PM with ExtUtils::MakeMaker on it makes everything work.

Re: Install Module with no admin permission
by Haarg (Curate) on Jul 06, 2017 at 09:33 UTC

    While the latest local::lib lists an ExtUtils::MakeMaker prerequisite of 7.00, it will usually work with versions back to 6.31. The newer prerequisite is because EUMM has changed how it parses some options, and local::lib produces the newer format. However, if you are only dealing with simple paths with no spaces or other special characters, the output of local::lib will work with older EUMM versions. If it is too much trouble trouble to get a newer EUMM, you can ignore the prerequisite warning.

    The --shelltype option requires local::lib 2.0. Without that option, local::lib does shell detection based on the SHELL environment variable. In your environment, the older version is detecting your shell properly.

    local::lib is meant to help with installing libraries in a separate directory, but it can't help with installing prerequisites. Since your machine is isolated from the internet, you'll need to either use a minicpan type solution, or resolve the prerequisites yourself by recursively installing them.

      Thanks for the clarificaiton, are you happy with the bootstrapping of local:lib/EUMM I suggested? With some rewording and a little work I'd be happy to raise a PR to add this to the documentation.

        Your suggestion included the --bootstrap option, which is primarily meant to download and install toolchain modules new enough for everything to work with local::lib. Your instructions include first upgrading ExtUtils::MakeMaker, but if an older CPAN.pm or Module::Build installed, the bootstrap process will try to upgrade them which in this case won't work. The bootstrapping process will ignore the failure and continue though. Also, the -I path used is wrong, but unnecessary. The proper paths to load the newly installed modules would be $HOME/perl5/lib/perl5, not $HOME/perl5/lib. But just passing a -I option wouldn't help the commands run by make find the newly installed ExtUtils::MakeMaker and its helper modules. The --bootstrap option takes care of getting the library paths set properly.

        My suggestion for manual bootstrapping from pre-downloaded files would probably be to extract both local::lib and ExtUtils::MakeMaker, then install with:

        eval `perl -I"$LOCAL_LIB_EXTRACTED_DIR/lib" -Mlocal::lib` cd $EXTUTILS_MAKEMAKER_EXTRACTED_DIR perl Makefile.PL && make test && make install cd $LOCAL_LIB_EXTRACTED_DIR perl Makefile.PL && make test && make install

A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1194235]
Approved by Discipulus
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2020-11-30 18:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?