Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

How can I find installed packages in a broken Perlbrew?

by monsignor (Acolyte)
on Dec 07, 2022 at 09:02 UTC ( [id://11148648]=perlquestion: print w/replies, xml ) Need Help??

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

When I upgraded my system I had to "deactivate" perlbrew by renaming ~/.perl5 and removing it from the path.

Is there an easy way to find out what packages I had installed? The easiest way for me to put things back is to do a fresh install of Perlbrew and then reinstall my packages.

  • Comment on How can I find installed packages in a broken Perlbrew?

Replies are listed 'Best First'.
Re: How can I find installed packages in a broken Perlbrew?
by kcott (Archbishop) on Dec 07, 2022 at 16:40 UTC

    G'day monsignor,

    I've been using Perlbrew for a very long time, certainly well in excess of a decade. Currently on Cygwin for 3-4 years; before that on Mac OS X (later macOS) for 8-9 years; and other systems before that whose details I don't immediately recall. I performed many upgrades on those systems and never had to mess with Perlbrew for any of them.

    I do not have ~/.perl5. Is that, by any chance, a typo in your post (and should be ~/perl5)? Here's some of what I have:

    $ env | grep BREW | sort PERLBREW_HOME=/home/ken/.perlbrew PERLBREW_MANPATH=/home/ken/perl5/perlbrew/perls/perl-5.36.0/man PERLBREW_PATH=/home/ken/perl5/perlbrew/bin:/home/ken/perl5/perlbrew/pe +rls/perl-5.36.0/bin PERLBREW_PERL=perl-5.36.0 PERLBREW_ROOT=/home/ken/perl5/perlbrew PERLBREW_SHELLRC_VERSION=0.86 PERLBREW_VERSION=0.86

    I checked in https://perlbrew.pl/ and noticed the latest version is 0.96. As you can see above, I have version 0.86. I then checked in https://perlbrew.pl/Installation.html in case I'd missed some change: that's still showing ~/perl5; no mention of ~/.perl5.

    If you could tell us a bit more about what system you're using, what the upgrade involved, and why you 'had to "deactivate" perlbrew', we might be able to provide better help.

    A package manager (apt, rpm, zypper, etc.) would normally install system Perl modules. With Perlbrew, you'd use something else (cpan, cpanm, manual 'make' install, etc.). It would be useful if you described the interaction between your package manager and Perlbrew.

    — Ken

      Thanks for the reply. I ran the "automatic upgrade" from Linux Mint 20.3 to Linux Mint 21. In order to do this I had to remove a bunch of PPAs and a few other packages that were not compatible with LM21. Thanks for pointing it out, you are right I should have said ~/perl5. When I tried to run perlbrew or a perl script I was getting these errors:

      $ perlbrew ListUtil.c: loadable library and perl binaries are mismatched (got han +dshake key 0xcd00080, needed 0xeb00080) $ perl imap-test.pl ListUtil.c: loadable library and perl binaries are mismatched (got han +dshake key 0xcd00080, needed 0xeb00080) [download]

      I changed ~/perl5 to ~/perl5-deactivated

      and that allowed me to run perl. I ran:
      ~/perl5--deactivated/perlbrew$ bin/perlbrew version bin/perlbrew - App::perlbrew/0.94

      What is the best way forward? I noted that the latest version is 0.96. If I change the directory back to perl5 and run the install script will it upgrade everything?

        "I changed ~/perl5 to ~/perl5-deactivated ... and that allowed me to run perl. ... If I change the directory back to perl5 ..."

        Look in your PERLBREW_* environment variables. Perhaps you need to change instances of perl5-deactivated to perl5.

        Also look in your ~/.bashrc (or equivalent). Maybe similar changes are needed there.

        "~/perl5--deactivated/perlbrew$ bin/perlbrew version"

        Is it ~/perl5-deactivated, or ~/perl5--deactivated, or something else?

        — Ken

Re: How can I find installed packages in a broken Perlbrew?
by hv (Prior) on Dec 07, 2022 at 19:45 UTC

    I don't know exactly how to find it in the general case (and I do not use perlbrew), but there is a file perllocal.pod to which module installations are written.

    For example, I have a local installation of perl in /opt/maths-5.34.0, and it has this file at /opt/maths-5.34.0/lib/perl5/5.34.0/x86_64-linux/perllocal.pod.

    The first entry in my perllocal.pod looks like this:

    =head2 Mon Feb 28 14:46:21 2022: C<Module> L<Algorithm::Loops|Algorith +m::Loops> =over 4 =item * C<installed into: /opt/maths-5.34.0/lib/perl5/site_perl/5.34.0> =item * C<LINKTYPE: dynamic> =item * C<VERSION: 1.032> =item * C<EXE_FILES: > =back
Re: How can I find installed packages in a broken Perlbrew?
by karlgoethebier (Abbot) on Dec 07, 2022 at 17:56 UTC

    I wonder what you really did and why. Normally your perlbrew stuff in your home is untouched in the case of an upgrade or whatever. Did you move the directory, ja? If so what prevents you from moving it back an giving it a try. See here for some useful information. BTW, what distro do you use? And remember next time: Some backup before an upgrade/update is always a good idea. Good luck, Karl

    «The Crux of the Biscuit is the Apostrophe»

Re: How can I find installed packages in a broken Perlbrew?
by kcott (Archbishop) on Dec 09, 2022 at 11:09 UTC
Re: How can I find installed packages in a broken Perlbrew?
by ikegami (Patriarch) on Dec 08, 2022 at 21:23 UTC

    No idea why you renamed the dir. The obvious solution is to rename it back.

    Otherwise, I believe find -name .packlist in the correct build's installation directory will list all the installed distributions.

Re: How can I find installed packages in a broken Perlbrew?
by karlgoethebier (Abbot) on Dec 08, 2022 at 12:12 UTC

    One more thing: It might be helpful to determine which modules came with your version of Perl. See Module::CoreList and this funny tool to make this task a little bit easier. Regards.

    «The Crux of the Biscuit is the Apostrophe»

      You simply have to check in which directory it's installed.

      Core modules bundled with Perl:

      $ perl -V:'install(privlib|archlib)' installarchlib='/.../lib/5.36.0/x86_64-linux-thread-multi'; installprivlib='/.../lib/5.36.0';

      Installed by user:

      $ perl -V:'installsite(lib|arch)' installsitearch='/.../lib/site_perl/5.36.0/x86_64-linux-thread-multi'; installsitelib='/.../lib/site_perl/5.36.0';

      You might find a module in both if you upgraded a core module.

Re: How can I find installed packages in a broken Perlbrew?
by Anonymous Monk on Dec 07, 2022 at 13:54 UTC
    Rename it back?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11148648]
Approved by Discipulus
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-25 11:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found