CPAN.pm has /root as default home

Discussion in 'Perl Misc' started by amirkarger@gmail.com, Aug 10, 2005.

  1. Guest

    Hi.

    Our sysadmin installs a bunch of Perl stuff using CPAN.pm. I decided to
    try and use CPAN.pm today, but I got this:

    Your configuration suggests "/root/.cpan" as your
    CPAN.pm working directory. I could not create this directory due
    to this error: mkdir /root/.cpan: Permission denied at
    /usr/local/lib/perl5/5.8.6/CPAN.pm line 553

    In retrospect, that's not so surprising. CPAN::Config.pm says:

    'cpan_home' => q[/root/.cpan],

    Obviously I'm not allowed to write to there, but CPAN::Config.pm is
    where CPAN.pm assumes it should put stuff unless you tell it otherwise
    in ~/.cpan/CPAN/MyConfig.pm.

    So here's my question: is it generally better to create a MyConfig.pm
    before using CPAN.pm, or can we write
    'cpan_home' => "$ENV{HOME}/.cpan"
    (and do the same to build_dir etc.)?

    The former solution requires every user who wants to use CPAN.pm to
    create a .cpan before running cpan. More likely, they'll just decide
    CPAN's not working. So I prefer the latter. Is there anything wrong
    with using ENV{HOME}? How do other people handle this situation?

    -Amir Karger
     
    , Aug 10, 2005
    #1
    1. Advertising

  2. Guest

    wrote:
    > Hi.
    >
    > Our sysadmin installs a bunch of Perl stuff using CPAN.pm. I decided to
    > try and use CPAN.pm today, but I got this:
    >
    > Your configuration suggests "/root/.cpan" as your
    > CPAN.pm working directory. I could not create this directory due
    > to this error: mkdir /root/.cpan: Permission denied at
    > /usr/local/lib/perl5/5.8.6/CPAN.pm line 553
    >
    > In retrospect, that's not so surprising. CPAN::Config.pm says:
    >
    > 'cpan_home' => q[/root/.cpan],
    >
    > Obviously I'm not allowed to write to there, but CPAN::Config.pm is
    > where CPAN.pm assumes it should put stuff unless you tell it otherwise
    > in ~/.cpan/CPAN/MyConfig.pm.


    Last time I brought this up, I suggested that CPAN should, rather than just
    complaining that you can't write into root's home directory, offer to
    create and configure a new .cpan in your own home directory. Someone
    replied that it does do this already, so I just dismissed it as my own
    system's idiosyncricity.


    > So here's my question: is it generally better to create a MyConfig.pm
    > before using CPAN.pm, or can we write
    > 'cpan_home' => "$ENV{HOME}/.cpan"
    > (and do the same to build_dir etc.)?
    >
    > The former solution requires every user who wants to use CPAN.pm to
    > create a .cpan before running cpan. More likely, they'll just decide
    > CPAN's not working. So I prefer the latter. Is there anything wrong
    > with using ENV{HOME}?


    It seems to have worked for me. I haven't exhaustively it, so I can't
    say there is nothing wrong with it. One potential problem is that every
    Tom, Dick, and Harry will be taking up disk space with their own
    individual copies of hundreds of modules, whereas if they were forced to go
    to the sysadmin there would be only one centralized copy of each module.


    > How do other people handle this situation?


    Until just now, I haven't handled it. Where I was root, I didn't need to
    handle it as I just installed what I wanted as root, and where I was not
    root I had no opportunity to handle it.

    >
    > -Amir Karger


    Xho

    --
    -------------------- http://NewsReader.Com/ --------------------
    Usenet Newsgroup Service $9.95/Month 30GB
     
    , Aug 10, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. carl d.
    Replies:
    1
    Views:
    407
    A. Sinan Unur
    May 10, 2005
  2. Replies:
    5
    Views:
    215
    Randy Kobes
    Oct 12, 2005
  3. Ben Bullock
    Replies:
    12
    Views:
    299
    Ben Bullock
    Jul 8, 2008
  4. SVCitian
    Replies:
    1
    Views:
    986
    SVCitian
    Oct 22, 2010
  5. PerlFAQ Server
    Replies:
    0
    Views:
    177
    PerlFAQ Server
    Jan 24, 2011
Loading...

Share This Page