in reply to (Never Ending) Module Installation Issues

You need to tell it where you want modules installed if you want them installed in a different location than the one you specified when you compiled perl. For example, you can use
perl Makefile.PL INSTALLBASE=~ make make test make install

It's similar for Module::Build modules:

perl Build.PL --install_base ~ ./Build ./Build test ./Build install

You can configure cpan to do that.

o conf makepl_arg 'INSTALLBASE=~' o conf mbuildpl_arg '--install_base ~' o conf commit # To use these settings in future sessions too.

PERL5LIB should be set to ~/lib/perl5 for INSTALLBASE=~. You can specify LIB=... in addition to INSTALLBASE=... if you want to further specify where modules should be installed.

Replies are listed 'Best First'.
Re^2: (Never Ending) Module Installation Issues
by listanand (Sexton) on Jun 08, 2010 at 20:13 UTC
    I am trying to install DBI module right now. After I did the above, and tried to install DBI, I got the error:

    ERROR: Can't create '/usr/local/bin' Do not have write permissions on '/usr/local/bin'
    I tried to say 'o conf LIB=~' also (in addition to INSTALLBASE) but got the error:

    Warning: unknown configuration variable 'LIB=~'
    I have tried installing with local::lib also, but have had no success as you can see here : http://www.perlmonks.org/?node_id=785906

    Looking forward to more help !

    Thanks.

    Andy

      The INSTALLBASE wasn't used if you got that error. Maybe you're using an old version of the build tools. (I thought that gave a warning?) Try

      o conf makepl_arg 'PREFIX=~ LIB=~/lib/perl5'
        I set the INSTALLBASE, LIB and PREFIX, and after that tried to install Bundle::DBD::mysql from CPAN shell. What I noticed is that it is trying to connect to mysql using my username and password. It obviously does not have my password, and so is trying to login using blank password.

        I then try to install it manually using:

        perl Makefile.PL --testuser=andy --testpassword=password PREFIX=/home/ +andy
        After that it said:

        Note (probably harmless): No library found for -lmysqlclient

        After that when I try to "make" it, I get plenty of errors, first few lines of which are:

        dbdimp.h:22:49: error: mysql.h: No such file or directory + + dbdimp.h:23:45: error: mysqld_error.h: No such file or directory + + dbdimp.h:25:49: error: errmsg.h: No such file or directory
        Any suggestions?

        Thanks.

        Andy