During routine maintenance I noticed that CPAN was failing operate properly and giving me an error I had not seen before.

Undefined subroutine &Compress::Zlib::gzopen called at /usr/lib/perl5/5.8.8/CPAN.pm line 5721

This may have happened when I installed awstats on my CentOS5 VPS. It grabbed a yum for Compress::Zlib. I suspect something
odd happened and and now CPAN fails. I lack the time right now to track this down for sure.

The fix is to manually bring things into compliance. Using the YUM to obtain the perl-Package-Name would probably be a good Idea but they do not appear to be quite right. The following is what I ended up doing although the path to get here felt like 2 steps forward 1 back. All files were retrieved manually from www.cpan.org via wget (use CPAN search and use the package name as the term) and then the standard Perl mantra; perl Makefile.PL, make, make test, make install. The order of installs is important! I determined the order by examing the warnings from perl Makefile.PL and make test.

  • Scalar::Util — required because IO:Compress failed test due to XS not being in my Scalar package
  • Compress::Raw::Bzip2
  • Compress::Raw::Zlib — per Compress::Zlib makefile operation
  • IO::Compress::Base — Update required for Compress::Zlib
  • IO::Compress::Gzip — per Compress::Zlib makefile operation
  • Compress::Zlib — the faulty package

After this was done all was good and CPAN now works!