CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: General Discussions: General Questions:
Problems with installing CPAN modules without root

 



oscarjiao
Novice

Sep 27, 2012, 8:45 AM

Post #1 of 7 (12815 views)
Problems with installing CPAN modules without root Can't Post

Hi, I am trying to install some CPAN modules on this cluster remotely. Perl is already installed on the cluster, there are a few modules missing, including DBI, DBD:SQLite, threads, etc, which are required by this package I will install eventually. Since I do not have root, I have to configure CPAN and point it to my directory. So I followed some instructions online and did the following:

Adding this to my bashrc:

Code
if [ -z "$PERL5LIB" ] 
then
# If PERL5LIB wasn't previously defined, set it...
PERL5LIB=~/myperl/lib
else
# ...otherwise, extend it.
PERL5LIB=$PERL5LIB:~/myperl/lib
fi

MANPATH=$MANPATH:~/myperl/man

export PERL5LIB MANPATH


@INC has been successfully updated after this.
Now

Code
o conf makepl_arg "LIB=~/myperl/lib INSTALLSITEMAN1DIR=~/myperl/man/man1 INSTALLSITEMAN3DIR=~/myperl/man/man3" o conf make_install_arg UNINST=0 o conf commit

Then I started to install module with CPAN (DBI in this case)

Code
perl -MCPAN -we 'install "DBI"'

It failed when running "make install", giving me the following error:
Warning: You do not have permissions to install into /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi at /usr/lib/perl5/5.8.8/ExtUtils/Install.pm line 114.
mkdir /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/DBI: Permission denied at /usr/lib/perl5/5.8.8/ExtUtils/Install.pm line 176
make: *** [pure_site_install] Error 13
/usr/bin/make install -- NOT OK
You may have to su to root to install the package

What does it still want to install in under /usr/... while I already changed the path? Is there a way to force it?


FishMonger
Veteran / Moderator

Sep 27, 2012, 9:21 AM

Post #2 of 7 (12812 views)
Re: [oscarjiao] Problems with installing CPAN modules without root [In reply to] Can't Post

Try adding:

Code
o conf makepl_arg PREFIX=~/myperl/lib



oscarjiao
Novice

Sep 27, 2012, 9:33 AM

Post #3 of 7 (12810 views)
Re: [FishMonger] Problems with installing CPAN modules without root [In reply to] Can't Post


In Reply To
Try adding:

Code
o conf makepl_arg PREFIX=~/myperl/lib



I tried this too, still the same error


FishMonger
Veteran / Moderator

Sep 27, 2012, 9:47 AM

Post #4 of 7 (12808 views)
Re: [oscarjiao] Problems with installing CPAN modules without root [In reply to] Can't Post

Have you tried downloading the tar file and building without using CPAN.pm?


oscarjiao
Novice

Sep 27, 2012, 9:52 AM

Post #5 of 7 (12806 views)
Re: [FishMonger] Problems with installing CPAN modules without root [In reply to] Can't Post


In Reply To
Have you tried downloading the tar file and building without using CPAN.pm?

I actually tried to install them manually first by downloading the src for each individual module. There are too many dependency issue. It asked me to install a lot of modules required for DBI. Besides, some of the modules already installed have very old version while the module to be installed need newer version of these. Since the old modules were installed by the admin, there is no way I could update them. My question is if I install the modules by cpan, would I come across with the same problems (module dependencies, version too old, etc.)?


FishMonger
Veteran / Moderator

Sep 27, 2012, 10:10 AM

Post #6 of 7 (12804 views)
Re: [oscarjiao] Problems with installing CPAN modules without root [In reply to] Can't Post

If the module(s) you install to your local dir have module version dependencies, then you will also need to install/upgrade those dependencies.

Since cpan is trying to install the module to the system path rather than the path you specify in the PREFIX param, then it would appear that the config settings you set didn't get saved.

When you tried installing them from src manually, did you specify the PREFIX arg when executing perl Makefile.PL?

Going back to using CPAN.pm, did you follow the steps listed here?
http://servers.digitaldaze.com/extensions/perl/modules.html


oscarjiao
Novice

Sep 27, 2012, 12:37 PM

Post #7 of 7 (12800 views)
Re: [FishMonger] Problems with installing CPAN modules without root [In reply to] Can't Post


In Reply To
If the module(s) you install to your local dir have module version dependencies, then you will also need to install/upgrade those dependencies.

Since cpan is trying to install the module to the system path rather than the path you specify in the PREFIX param, then it would appear that the config settings you set didn't get saved.

When you tried installing them from src manually, did you specify the PREFIX arg when executing perl Makefile.PL?

Going back to using CPAN.pm, did you follow the steps listed here?
http://servers.digitaldaze.com/extensions/perl/modules.html


I did specify Prefix when I was installing CPAN modules manually. As a matter of fact, I did get DBI installed that way under my dir. Well, "make test" gave me some errors , but "make install" works fine and I see some dbi directories generated under my dir including bin, lib, etc.

If like you said, installing modules within Cpan shell is essentially the same as manual install and I will still be facing the dependencies, I might as well install the whole perl package under my directory. However, it fell into a dead loop while running make for module 'DBI'. Complaining that "Running make for A/AD/ADAMK/DBD-SQLite-1.37.tar.gz
---- Unsatisfied dependencies detected during ----
---- ADAMK/DBD-SQLite-1.37.tar.gz ----
DBI [build_requires]

Do you know what is causing this?

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives