jlk has asked for the wisdom of the Perl Monks concerning the following question:

Ok, I have an issue and I am not sure what is causing it. I am working on a Fedora Core 7 Linux machine (my laptop). I have not had any problems with installing modules via CPAN up till now, and everything that I have installed has installed just fine since I initially configured the interface during its first run.

Yesterday I tried to run the command line to install a module (CGI) and it failed. So, I tried again, only with the Bundle::CPAN module(which I had done a few weeks ago just fine), and that bombed as well.

Here is what I am getting whenever I try to install any module:

$ sudo perl -MCPAN -e 'install Bundle::CPAN' CPAN: Storable loaded ok Going to read /home/jlk/.cpan/Metadata Database was generated on Fri, 31 Aug 2007 12:36:44 GMT Going to read /home/jlk/.cpan/sources/authors/01mailrc.txt.gz CPAN: LWP::UserAgent loaded ok Fetching with LWP: http://www.perl.com/CPAN/modules/02packages.details.txt.gz Going to read /home/jlk/.cpan/sources/modules/02packages.details.txt.g +z Undefined subroutine &Compress::Zlib::gzopen called at /usr/lib/perl5/ +5.8.8/CPAN.pm line 5721.

Again, I have not made any changes to my installation recently. The only things that could be considered changes to my machine would be updates and I have not seen anything even remotely Perl related coming down for update.

Any assistance with this is greatly appreciated.

Best regards,

Jeff

"Every time Linux boots, a penguin gets its wings"

Replies are listed 'Best First'.
Re: Need help with CPAN gone awry
by shmem (Chancellor) on Sep 15, 2007 at 13:47 UTC
    Since you are on Fedora and thus have yum, it is a good idea to install perl packages via RPM. Add the following file to your /etc/yum.repos.d/ directory:
    # file dries.repo [dries] name=Extra Fedora rpms dries - $releasever - $basearch baseurl=http://ftp.belnet.be/packages/dries.ulyssis.org/fedora/fc$rele +asever/$basearch/RPMS.dries/

    For packages that aren't in this repo, I'd suggest RPM::Specfile and subsequent packaging with cpanflute2 included there.

    Note that you have to disable the somewhat braindead /usr/lib/rpm/perl.req like so

    foreach $module (sort keys %require) { if (length($require{$module}) == 0) { - print "perl($module)\n"; + warn "perl($module)\n"; } else { # I am not using rpm3.0 so I do not want spaces arround my # operators. Also I will need to change the processing of the # $RPM_* vairable when I upgrage. - print "perl($module) >= $require{$module}\n"; + warn "perl($module) >= $require{$module}\n"; } }

    since otherwise you would end up with packages that require perl-Foo-Bar, Foo::Bar being a core package.

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

      Thank you very much shmem, I really appreciate your replying. I will definitely look into setting up to install modules the way you mentioned as it is always good to have another way to install them.

      Unfortunately, the module "CGI" is not part of the RPM's. They seem to have the other CGI modules and whatnot, but not that one. Do you have any idea what the issue could be with the way my machine is presently configured to install modules? I would love to get that method working again, as well. Thanks! Jeff

      "Every time Linux boots, a penguin gets its wings"

        it is always good to have another way to install them.

        More than being "another way", it is always good to install packages in a OS compliant way. And that's RPM and yum on Fedora.

        Unfortunately, the module "CGI" is not part of the RPM's.

        It isn't, because it's in perl core:

        qwurx [shmem] ~ > cat /etc/redhat-release Fedora release 7 (Moonshine) qwurx [shmem] ~ > perl -MCGI -le 'print $INC{"CGI.pm"}' /usr/lib/perl5/5.8.8/CGI.pm qwurx [shmem] ~ > rpm -qf /usr/lib/perl5/5.8.8/CGI.pm perl-5.8.8-23.fc7

        No need to install CGI.

        update: while you're at it, do a

        rpm -q perl-Compress-Zlib

        If it isn't there, do a yum install perl-Compress-Zlib :-)

        --shmem

        _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                      /\_¯/(q    /
        ----------------------------  \__(m.====·.(_("always off the crowd"))."·
        ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
Re: Need help with CPAN gone awry
by perrin (Chancellor) on Sep 15, 2007 at 20:54 UTC
    Here's my guess: either you aren't up to date with Fedora and it has a new perl package that you need (because a C library being used by it was updated) or else you installed some modules through the CPAN shell at some point and Fedora updated your perl and now those modules no longer work. If it's the latter, I think you can fix the immediate problem by downloading the latest Compress::Zlib from CPAN (manually, not with the CPAN shell) and then installing it manually.