Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Symbol lookup error for my ~/perl5/lib/perl5

by Lady_Aleena (Curate)
on Jun 05, 2019 at 19:12 UTC ( #11101026=perlquestion: print w/replies, xml ) Need Help??

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

Hello. I am getting a symbol lookup error when trying to install a module to ~/perl5/lib or use that lib in apache2.

When trying to install a module with cpan I get the following:

/usr/bin/perl: symbol lookup error: /home/me/perl5/lib/perl5/x86_64-li +nux-gnu-thread-multi/auto/List/Util/Util.so: undefined symbol: Perl_x +s_apiversion_bootcheck

When I used that directory in apache2, I get the following error in my error log:

/usr/bin/perl: symbol lookup error: /home/me/perl5/lib/perl5/x86_64-li +nux-gnu-thread-multi/auto/List/Util/Util.so: undefined symbol: Perl_x +s_apiversion_bootcheck

I don't know if it is just List::Util that has a problem or my entire ~/perl5/lib.

This issue happened after I upgraded my Debian distribution from 8 (Jessie) to 9 (Stretch). perl -v returns the following:

This is perl 5, version 24, subversion 1 (v5.24.1) built for x86_64-li +nux-gnu-thread-multi

which perl returns:

/usr/bin/perl

I can not think of anything else I need to add that will help with figuring out this problem.

All help is appreciated!

This issue appears to be resolved. The suggestion of an Anonymous Monk to rename the dir and reinstall the modules seems to have worked. Thank you all for your patience.

No matter how hysterical I get, my problems are not time sensitive. So, relax, have a cookie, and a very nice day!
Lady Aleena

Replies are listed 'Best First'.
Re: Symbol lookup error for my ~/perl5/lib/perl5
by bliako (Vicar) on Jun 06, 2019 at 00:02 UTC

    karlgoethebier is right in the sense that you may not have now two Perls but over time you did have two or more Perls via the upgrades. The error message tells me that List::Util has not been recompiled and linked with the new Perl after the Perl exe upgrade. When an upgrade happens, then all modules which have XS/C components must be re-compiled and re-linked to the new Perl. But often the list of said modules is incomplete (perhaps because we usually do not upgrade via the system's package manager but Perl's package manager). So (re)installing List::Util (and all Perl modules) via the system's package manager will most likely fix the problem (*). Be warned that forcing a Perl upgrade may break some things in your system because GNU/Linux uses Perl for housekeeping and certain versions need certain Perl versions etc. The solution is perlbrew. It will allow you to have as many Perls as you wish without tampering with system's Perl at all.

    Edit thanks marto: *) If you can't use the system's package manager then you can use cpan-outdated to list all outdated modules and possibly pipe its output to cpanm for reinstalling. For example: cpan-outdated | cpanm -L ~/perl5 --reinstall.

    Edit2 anonymous monk below (Re: Symbol lookup error for my ~/perl5/lib/perl5) makes a valid point that cpanm may not work because of this incompatibility and suggests a workaround

      "So (re)installing List::Util (and all Perl modules) via the system's package manager will most likely fix the problem."

      Many people install to a local directory (also local::lib) do so because they specifically can't (or don't want to) alter the system perl.

Re: Symbol lookup error for my ~/perl5/lib/perl5
by karlgoethebier (Monsignor) on Jun 05, 2019 at 20:07 UTC

    Let me guess: Do you have two versions of Perl installed on your box? Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

    perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

      Not that I am aware of.

      No matter how hysterical I get, my problems are not time sensitive. So, relax, have a cookie, and a very nice day!
      Lady Aleena
Re: Symbol lookup error for my ~/perl5/lib/perl5
by Anonymous Monk on Jun 06, 2019 at 14:19 UTC

    TL;DR: mv ~/perl5 ~/perl5.bak should restore scripts such as cpan that depend on List::Util but get the version compiled for older version of Perl from ~/perl5.

    This has happened because Debian Jessie has Perl v5.20, Debian Stretch has v5.24, both Perls expect their modules to be in ~/perl5 (probably via local::lib) but are binary incompatible. It is likely that you have the compatible version of List::Util (and other cpan dependencies) installed somewhere in /usr, but modules installed via local::lib take precedence and manage to crash the interpreter before it can use right one.

    One your Perl installation works, you can visit ~/perl5.bak to see which modules you would need to install again, for the new version of Perl.

      Will cpan rebuild ~/perl5 when I go to reinstall the modules or do I need to recreate some of the directory structure?

      No matter how hysterical I get, my problems are not time sensitive. So, relax, have a cookie, and a very nice day!
      Lady Aleena

        Splendid advice was already given by some fellow monks. Just a little addendum: For the future i would recommend that you make it so. Didn‘t I mention this already 😎 ? Best regards, Karl

        «The Crux of the Biscuit is the Apostrophe»

        perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

        I think that cpan should be able to rebuild everything by itself. At most, mkdir ~/perl5 might be needed but probably isn't.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://11101026]
Approved by Paladin
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2019-10-20 16:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?