http://qs321.pair.com?node_id=1095547

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

My perlbrew is broken after upgrading from xubuntu 13.10 to xubuntu 14.04.

The $PATH variable now contains just this entry: /home/lcarter/perl5/perlbrew/bin:/home/lcarter/perl5/perlbrew/perls/perl-5.16.3/bin

I then manually added the contents of the /etc/environment to the $PATH variable.

Now I am getting this: Can't locate App/perlbrew.pm in @INC

I do have perlbrew.pm in /usr/local/share/perl/5.14.2/App/perlbrew.pm.

I would greatly appreciate your help.

Replies are listed 'Best First'.
Re: perlbrew is broken
by wjw (Priest) on Jul 30, 2014 at 04:14 UTC

    Just as a check: Did you include the following in your .bashrc?(assuming bash of course...)

    source ~/perl5/perlbrew/etc/bashrc

    I had forgotten to do so on one of my laptops(Ubuntu 14.04) and experienced something similar to what you describe..until I fixed my .bashrc, that is.

    Hope that helps...

    ...the majority is always wrong, and always the last to know about it...

    Insanity: Doing the same thing over and over again and expecting different results...

    A solution is nothing more than a clearly stated problem...otherwise, the problem is not a problem, it is a facct

      Thx for your response. In reply to your question: yes I have the source ~/perl5/perlbrew/etc/bashrc in my 14.04 and in my older version.

      lc
Re: perlbrew is broken
by bigj (Monk) on Jul 30, 2014 at 07:23 UTC
    If you look to the version nrs in your paths, xubuntu updated from perl 5.14.2 in your former xubuntu 13.10 to the more modern perl 5.16.3 in xubuntu 14.04.

    I would bet the your lib directory now also refs to /usr/local/share/perl5.16.3 instead of the former link to /usr/local/share/perl5.14.2.

    That's why allthough perlbrew is installed (for perl5.14.2), the newer perl version has the newer link to the new lib directory.

    Solutions to bypass it would be to create a symlink to the former path, to add it in -I directive when calling perl, add it to the $LIB (not $PATH variable) in your bashrc or to reinstall perlbrew in new perl environment or w/e I might have forgot now.

    Personal, I'd let xubuntu just like it is, so other programs that rely via rpm package management or so do it, but just install locally my preferred perl version(s) and work with them. So you can't broke any 3rd program and still can control your own development/production environment and also work with the most modern Perl if you intend so (5.18 or 5.20).

    Greetings,
    Janek Schleicher

      Solutions to bypass it would be to create a symlink to the former path, to add it in -I directive when calling perl, add it to the $LIB (not $PATH variable)

      $LIB is not a perl thing or a perlbrew thing

      The simplest solution to not having perlbrew break in the future, is to have one of your perlbrew perls as the first perl in the path, so when you type perl or perlbrew its the one from your home directory that runs, so when you upgrade your OS and your system perl (os perl), your home directory perlbrew installed perl is untouched and works the same

        Thx for your reply.

        The perlbrew libs were the first in my $PATH.

        lc

Re: perlbrew is broken
by ikegami (Patriarch) on Jul 30, 2014 at 16:01 UTC
    Please provide the output of the following commands:
    echo "$shell" echo "$SHELL" /usr/bin/perl -le'print for grep /perl/, split /:/, $ENV{PATH}' which perl which perlbrew echo "$PERLBREW_ROOT" /usr/bin/perl -le'local $/; $_ = <>; print substr($_, 0, 500);' \ "${PERLBREW_ROOT:-$HOME/perl5/perlbrew}/bin/perlbrew"

    (The last command assumes bash or something similar. Adjust as needed.)

      Thx for your reply ikegami,

      I have since restored my original xubuntu 13.10 from backups -- I was getting a little bit desperate. The restored perlbrew installation is working now.

      This is not much of a solution, though, as I need to upgrade my xubuntu to 14.04.

      I think I need to backup my perlbrew install independent of my general backup. And then install the perlbrew modules separately in another system. I was reading some literature regarding that. But I'd definitely appreciate your input on that. I am beginning to feel that I am out of my depths here.

      I still would like to understand how the upgrade broke the perlbrew install. So I will try to re-create the problem as soon as I can get perlbrew installed properly in an upgraded xubuntu.

        As others have said, the simplest thing would've been to re-install Perlbrew. It takes a couple seconds to install and you don't need admin privs. After your re-update, please just re-install Perlbrew if you run into problems again. (Of course, re-installing another version of Perl will take longer, but certainly not as long as upgrading your system, reverting, and then re-upgrading.)
Re: perlbrew is broken (Can't locate App/perlbrew.pm in @INC)
by Anonymous Monk on Jul 30, 2014 at 06:57 UTC

    perlbrew is broken...Can't locate App/perlbrew.pm in @INC

    That just means you don't have perlbrew installed

    Whatever perlbrew executable you're running doesn't have App::perlbrew installed where it can find it... so reinstall App::perlbrew, say using cpanm or some such,

      Thx for replying to my post.

      I do have perlbrew installed: Said module is in: /usr/local/share/perl/5.14.2/App/perlbrew.pm

      lc

        I do have perlbrew installed

        So then there is no problem right?

        Do you want to solve it, yes or no?

        When you type "perlbrew"  which perlbrew is run? using which perl? What is shebang of this  which perlbrew?

        If perlbrew cannot find the corresponding App::perlbrew then its not installed :) where you want it

        Simple solution, install the module, then install it using perlbrew into one of your perlbrew perls, then set this as your default perl as first perl in your $path