Pradyumna Sagar
Pradyumna Sagar

Reputation: 403

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.

Upvotes: 9

Views: 11319

Answers (3)

Y.Y. Liang
Y.Y. Liang

Reputation: 1

I've also encountered this issue while running a Bioinformatics tool "BRAKER3" via Singularity container.

Most of the answers pointing to the clash between the Perl installed by Root and Perl Library installed by user.

Without Root access, I solved this problem by deleting all environment variables of Perl Library install by user (me) such as $PERL5LIB and adding export PERL5LIB="/usr/lib/perl5:/usr/local/lib/perl5" to my script as well to literally use the Perl things building by Root.

Upvotes: 0

Some
Some

Reputation: 514

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.

Upvotes: 10

Prabah
Prabah

Reputation: 867

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.

Upvotes: 4

Related Questions