所有Perl模块和'cpan'在Ubuntu 16.04 LTS升级到18.04 LTS后停止工作。每次我运行我的脚本都会导致错误
threads.c: loadable library and Perl binaries are mismatched (got handshake key 0xdb00080, needed 0xde00080)
当我尝试打开cpan时显示
Cwd.c: loadable library and Perl binaries are mismatched (got handshake key 0xdb00080, needed 0xde00080)
我在ubuntu 16.04中安装了“Cwd”,“threads”模块,其中Perl版本是5.22.1,而在ubuntu 18.04中,Perl版本是5.26.1。
我尝试删除旧版本的模块但失败了。我删除了〜/ .cpan文件夹中的内容。
PS: root用户一切正常。 如果我跑
sudo su
cpan
完美无缺。但作为普通用户,我无法运行任何perl modules / scripts / cpan。
如何更正此问题? 如何重新安装cpan或cpan模块?
我尝试重新安装没有帮助的Perl
sudo apt-get --reinstall install perl
sudo apt-get --reinstall install libcwd-guard-perl
我安装了cpan减去,cpan plus,它给出了同样的错误。
答案 0 :(得分:1)
我通过遵循https://github.com/Perl/perl5/issues/15861
解决了此问题我运行了perl -MCPAN -e 'recompile()'
命令
它重新编译了所有模块,终于工作了。
答案 1 :(得分:1)
要解决问题,可以使用下一个链接:
https://dev.to/foursixnine/about-perl-and-mismatched-binaries-346l https://metacpan.org/pod/release/DBOOK/App-MigrateModules-0.002/script/perl-migrate-modules
或在命令中:(替换为您的perl5文件夹,在我的情况下为〜/ perl5)
mv <perl5> perl5_old
cpan
cpan App::MigrateModules
perl-migrate-modules --from perl5_old /usr/bin/perl
在您的perl5文件夹中,通常在路径中的ENV变量PERL5LIB中存在。