35

For some reason, whenever I run any Perl module (like cpanm), I've been getting this response:

ListUtil.c: loadable library and perl binaries are mismatched (got         
handshake key 0xdb00080, needed 0xdb80080)

I'm not sure why this is happening. There doesn't seem to be any additional stacktrace, and even though there have been numerous bug reports and questions on this error, I was unable to find a solution. I'm running Ubuntu 17.04.

Edit: I'm running the default installation of Perl that ships with Ubuntu.

javathunderman
  • 1,074
  • 2
  • 13
  • 31
  • That means the `List::Util` on your system was built for a different version of perl. Are you using the standard Ubuntu perl? Have you tried reinstalling `libscalar-list-utils-perl`? – melpomene Jul 09 '17 at 20:38
  • @melpomene Yeah, I'm running standard Perl that ships with Ubuntu. How would I reinstall that package? – javathunderman Jul 10 '17 at 01:18
  • I just started getting the same issue on macos 11.3. Trying to troubleshoot and posting my findings here : https://stackoverflow.com/questions/67308565/mytop-on-big-sur-stopped-working-after-os-update – zayquan Apr 28 '21 at 22:16

4 Answers4

35

This may happen when perl or perl modules are installed separately along side the official packages. Environment variable can be used to switch to a different perl installation.

To find out if that is the case run:

env | grep PERL

Having PERL5LIB or PERL_LOCAL_LIB_ROOT in the output might cause the issue. Try unsetting the environment variables and remove them from your ~/.bashrc file or equivalent shell rc file.

Bert Hekman
  • 8,987
  • 3
  • 21
  • 14
5

Derived from Bert Hekman, answered Jul 5 at 8:22:

env PERL5LIB= PERL_LOCAL_LIB_ROOT= cpan

did the trick for me as a quick and dirty solution.

JensE
  • 51
  • 1
  • 1
2

Ok, turns out that a reboot did the trick. Guess I should have turned it off and on before I posted here.

brian d foy
  • 129,424
  • 31
  • 207
  • 592
javathunderman
  • 1,074
  • 2
  • 13
  • 31
  • 1
    I am running into the same case, differently, I have switched key value (got handshake key 0xdb80080, needed 0xde00080). And in my case, reboot can't solve it. My system is Ubuntu 18.04. – Qoros May 21 '18 at 08:32
2

Using the above answers, I solved this problem. I had a copy of List::Util in my local perl folder.

I set the environment variables, then used cpan to update List::Util.

$ PERL5LIB= PERL_LOCAL_LIB_ROOT= cpanm List::Util
--> Working on List::Util
Fetching http://www.cpan.org/authors/id/P/PE/PEVANS/Scalar-List-Utils-1.59.tar.gz ... OK
Configuring Scalar-List-Utils-1.59 ... OK
Building and testing Scalar-List-Utils-1.59 ... OK
Successfully installed Scalar-List-Utils-1.59 (upgraded from 1.55)
1 distribution installed

I then no longer needed to use PERL5LIB= or PERL_LOCAL_LIB_ROOT=, I could just call my perl scripts as normal.

Dave Smith
  • 87
  • 12