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

By mistake, I have installed a number of CPAN modules in /root. I did this by misconfiguring CPAN setup and accidentally picking local::lib as the option.

It doesn't work to have the modules located within /root as I need them to be accessible to all users.

I have read the documentation of local::lib, but I am struggling to understand it all.

My questions, then are:

  • Comment on Mistaken local::lib Module Installation

Replies are listed 'Best First'.
Re: Mistaken local::lib Module Installation
by Anonymous Monk on Nov 11, 2015 at 22:06 UTC

    Would it be safe to simply delete the directory /root/perl5?

    Yes

    ...local::lib...

    local::lib is when you want to install stuff in your home directory, when you're NOT root

Re: Mistaken local::lib Module Installation
by syphilis (Archbishop) on Nov 11, 2015 at 23:37 UTC
    •Would it be safe to simply delete the directory /root/perl5?

    Not if it's being used by the operating system. (Is it ?)

    Cheers,
    Rob

      How would I know?

      /root/perl5 was created by CPAN when I ran it with local::lib by accident, as described. It didn't exist before. There are other modules installed through the OS package manager (yum) and they are installed in other locations.

        It didn't exist before

        Then it's safe to remove.

        Sorry - in your original post I missed the implication that the directory did not previously exist.
        (I still don't see it there, though Anonymous apparently worked it out ;-)

        Cheers,
        Rob

        if cpan/local::lib created that directory, it is safe to delete it :)

        If you type perl -V and you'll see a bunch of stuff that ends like

        %ENV: PERL5LIB="/root/perl5/lib/perl5" @INC: /root/perl5/lib/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .

        local::lib overrides comes from %ENV vars like PERL5LIB , all the other ones come from Config or are compiled in, to get a list run <c> perl "-V:install.*" </c.

        Stuff from %ENV , once removed from %ENV, its as if it doesn't exist, so you can delete those dirs if you want