Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

All Perl modules and 'cpan' stopped working after an upgrade of Ubuntu 16.04 LTS to 18.04 LTS. Every time I run my script it leads to the error

threads.c: loadable library and Perl binaries are mismatched (got handshake key 0xdb00080, needed 0xde00080)

when I try to open cpan it shows

Cwd.c: loadable library and Perl binaries are mismatched (got handshake key 0xdb00080, needed 0xde00080)

I had installed "Cwd", "threads" modules in ubuntu 16.04 where Perl version was 5.22.1, whereas in ubuntu 18.04 the Perl version is 5.26.1.

I tried to remove the old version of modules but failed. I deleted content on ~/.cpan folder.

PS: Everything works fine in root user. if I run

sudo su
cpan

works perfectly. But as a normal user, I cant run any perl modules/scripts/cpan.

How do I correct the issue? How can I re-install cpan or cpan modules?

I tried to reinstall Perl which did not help

sudo apt-get --reinstall install perl
sudo apt-get --reinstall install libcwd-guard-perl

I installed cpan minus, cpan plus which gave the same error.

like image 306
Pradyumna Sagar Avatar asked May 21 '18 05:05

Pradyumna Sagar


2 Answers

For solve problem next links can be used:

https://dev.to/foursixnine/about-perl-and-mismatched-binaries-346l https://metacpan.org/pod/release/DBOOK/App-MigrateModules-0.002/script/perl-migrate-modules

Or in commands: (Replace to your perl5 folder, in my case it was ~/perl5)

 mv <perl5> perl5_old
 cpan
 cpan App::MigrateModules
 perl-migrate-modules --from perl5_old /usr/bin/perl

Where perl5 your perl folder, usually in path exists in ENV variable PERL5LIB.

like image 115
Some Avatar answered Sep 18 '22 13:09

Some


I solved this issue by following https://github.com/Perl/perl5/issues/15861

I ran the command perl -MCPAN -e 'recompile()'

It recompile all the module, at last it worked.

like image 29
Prabah Avatar answered Sep 18 '22 13:09

Prabah