0

I've got a big problem with my RHEL7 Perl installation. Whenever I try to run cpan, it gives me the following error:

[michael@xlinfp101 ~]$ sudo cpan
[sudo] password for michael:
Socket object version 2.010 does not match bootstrap parameter 2.030 at /usr/lib64/perl5/DynaLoader.pm line 213.
Compilation failed in require at /usr/share/perl5/Net/Ping.pm line 12.
BEGIN failed--compilation aborted at /usr/share/perl5/Net/Ping.pm line 12.
Compilation failed in require at /usr/share/perl5/CPAN/Mirrors.pm line 43.
BEGIN failed--compilation aborted at /usr/share/perl5/CPAN/Mirrors.pm line 43.
Compilation failed in require at /usr/share/perl5/CPAN/FirstTime.pm line 11.
BEGIN failed--compilation aborted at /usr/share/perl5/CPAN/FirstTime.pm line 11.
Compilation failed in require at /usr/share/perl5/CPAN/HandleConfig.pm line 579.

The strange thing is, perl-Socket ist installed and there is no higher version of this module.

[michael@xlinfp101 Socket-2.030]$ sudo yum provides perl-Socket
Loaded plugins: product-id, rhnplugin, search-disabled-repos, subscription-manager, verify
This system is receiving updates from RHN Classic or Red Hat Satellite.
perl-Socket-2.010-3.el7.x86_64 : Networking constants and support functions
Repo        : rit-2020-09-rhel-x86_64-server-7

Furthermore, if I try to install it by hand (make), I can't due to this error:

[michael@xlinfp101 Socket-2.030]$ sudo perl Makefile.PL
Attempt to reload Socket.pm aborted.
Compilation failed in require at /usr/share/perl5/vendor_perl/IPC/Cmd.pm line 46.
BEGIN failed--compilation aborted at /usr/share/perl5/vendor_perl/IPC/Cmd.pm line 46.
Compilation failed in require at /usr/share/perl5/ExtUtils/CBuilder/Base.pm line 11.
BEGIN failed--compilation aborted at /usr/share/perl5/ExtUtils/CBuilder/Base.pm line 11.
Compilation failed in require at /usr/share/perl5/ExtUtils/CBuilder/Platform/Unix.pm line 4.
BEGIN failed--compilation aborted at /usr/share/perl5/ExtUtils/CBuilder/Platform/Unix.pm line 4.
Compilation failed in require at (eval 9) line 2.
BEGIN failed--compilation aborted at (eval 9) line 2.
Compilation failed in require at Makefile.PL line 19.

Edit 1: Running the perl shell is also not possible anymore...

[michael@xlinfp101 ~]$ sudo perl -MCPAN -e shell
Socket object version 2.010 does not match bootstrap parameter 2.030 at /usr/lib64/perl5/DynaLoader.pm line 213.

This strange behaviour occured first when I deleted some modules by hand (rm). I think I ruined something ...

Does anyone know a solution how to bring CPAN working again?

Thank you!

4
  • Usually a good start is to re-install the Perl packages from your Linux distribution, or restore a backup. – Bob Sep 15 '20 at 7:36
  • Why are you loading perl modules from a third party yum repository? Or is that your Satellite server? It's not clear and you didn't mention it. – Michael Hampton Sep 15 '20 at 12:39
  • because we are in a corporate network, but this isn't very necessary for the question i guess – Michael Gierer Sep 15 '20 at 13:55
  • We've seen many instances where the corporate Satellite server is not properly synced with the distribution repo it's supposed to be serving, which results in uninstallable packages, missing dependencies, general breakage, etc. While this might not have been the cause of your problem in this case, others who read this question should check on this. – Michael Hampton Sep 15 '20 at 19:25
1

After hours investigating time I have found a solution:

  1. uninstall all perl packets with YUM, including cpan and cpanminus (BUT: remember all the package names!)

  2. remove the app folders like .cpan and .cpanm in the home directories

  3. yum clean all

  4. download the source code of perl from the official website and build this one (i don't know whether this lead to success, but i guess, since only re-installing with yum didn't)

  5. verify that "perl -MCPAN -e shell" is working

  6. install all the perl packages including cpan and cpanminus again with YUM

finito.

Maybe some steps aren't necessary but I thought I share everything I've done.

And remember: NEVER DELETE ANYTHING FROM THE PERL SYSTEM LIBRARIES! :P

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.