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

I need to install Archive::Zip on a Linux server to deal with a 50MB .zip archive one file at a time.

The current version of Archive::Zip on CPAN comes as a zip file. The CPAN module on my server and/or the version of gzip (v. 1.2.4; Aug 93) does not seem to be able to handle the installation. Transcript follows:

cpan> install Archive::Zip Running install for module Archive::Zip Running make for N/NE/NEDKONZ/Archive-Zip-0.11.zip Fetching with LWP: ftp://carroll.cac.psu.edu/pub/CPAN/authors/id/N/NE/NEDKONZ/Archive-Z +ip-0.11.zip Scanning cache /root/.cpan/build for sizes Deleting from cache: /root/.cpan/build/Bundle-libnet-1.00 (10.1>10.0 M +B) Deleting from cache: /root/.cpan/build/XML-Parser-2.30 (10.1>10.0 MB) CPAN: MD5 loaded ok Fetching with LWP: ftp://carroll.cac.psu.edu/pub/CPAN/authors/id/N/NE/NEDKONZ/CHECKSUMS Checksum for /root/.cpan/sources/authors/id/N/NE/NEDKONZ/Archive-Zip-0 +.11.zip ok gzip: /root/.cpan/sources/authors/id/N/NE/NEDKONZ/Archive-Zip-0.11.zip + has more than one entry--rest ignored Cannot unzip, no unzip program available cpan>

The copy of Archive-Zip-0.11.zip in /root/.cpan/etc/etc is still there. When I "gzip -l" it to check the contents, all it lists is the file itself. No list of internal files... which makes me less than confident about continuing by hand with gzip and that .zip file.

Because this is a zip file, I am concerned also that the contents may be Windows-specific. So I'd like to know more before proceeding with a manual install.

The previous version of Archive::Zip is available as a .tar.gz and dates from March 2000. I could grab that older version for a manual install. I seem to remember a way to use the CPAN module to install a local .tar.gz file but I can't make sense of what little I can find on this. So perhaps the full manual 'Make' routine would be best if I go that route. But is that older version likely to handle a file recently zipped on an up-to-date Linux server?

These system setup issues are not my strong suit, so this seems like a good point to pause and consult with you all. How would you recommend I proceed?

Replies are listed 'Best First'.
Re: Problems installing Archive::Zip
by bikeNomad (Priest) on Jun 23, 2001 at 09:28 UTC
    Hi (neighbor) Dave,

    I believe I put both the .zip and the .tar.gz version on CPAN when I put 0.11 there. My guess is that your problem comes from running gzip on a .zip file, which it can't handle. Gzip can only handle .gz files. If you want to make CPAN install a .zip file (not that you need to), you need to install the Info-Zip tools to get zip and unzip. And you have to re-configure CPAN. It's probably easier just to ditch the .zip file and get the .tar.gz one.

    update: Yes, there is the tar.gz version at the same place.

      Ah-hah!

      The .tar.gz version of version 0.11 is in the author directory but not in the by-module directory. How do I force CPAN to grab the .tar.gz version.

      Failing that, I'll just go the Make route...

        You know, this is the first time I've noticed that. I'll get in touch with CPAN about it tomorrow. For some reason, every time I run cpan interactively it gets the .tar.gz version. Perhaps you could blow away the .zip version and the cached cpan indices and try again. Or you could get the info-zip tools and re-configure CPAN.pm? I have no idea how to fix cpan's idea of where to get a module. I'd ask Andreas Koenig <andreas.koenig@anima.de> how that all works. Odd that it works for most everybody (I've never heard of this particular problem).

        update: Or (which might be much easier), just grab the .tar.gz, unpack it somewhere, then go:

        perl Makefile.PL make make test make install # as root

        update: After some thought, it looks like your CPAN.pm may be misconfigured. If you go o conf at the cpan interactive prompt, you can see its configuration. You should look at the settings for:

        build_dir /usr/local/cpan/build cpan_home /usr/local/cpan gzip /bin/gzip keep_source_where /usr/local/cpan/sources keep_sources_where /usr/local/cpan/sources tar /bin/tar unzip /usr/bin/unzip
        and make sure that they're all correct. Especially make sure that unzip is set to something that can handle .zip files. It sounds like your unzip is set to point to gzip.