Home > Net >  Perl modules not installing. sh: 1: gzip: Exec format error
Perl modules not installing. sh: 1: gzip: Exec format error

Time:11-07

I am getting issues when trying to install Perl modules on Ubuntu running on Windows 10. I am not sure the best way to post the output, I am guessing maybe as "code"

$ cpan HTTP::Tiny
Loading internal logger. Log::Log4perl recommended for better logging
Reading '/home/user/.cpan/Metadata'
  Database was generated on Sun, 06 Nov 2022 23:29:01 GMT
Running install for module 'HTTP::Tiny'
Fetching with HTTP::Tiny:
http://www.cpan.org/authors/id/D/DA/DAGOLDEN/HTTP-Tiny-0.082.tar.gz
Fetching with HTTP::Tiny:
http://www.cpan.org/authors/id/D/DA/DAGOLDEN/CHECKSUMS
Checksum for /home/user/.cpan/sources/authors/id/D/DA/DAGOLDEN/HTTP-Tiny-0.082.tar.gz ok
sh: 1: /usr/bin/gzip: Exec format error
/usr/bin/tar: This does not look like a tar archive
/usr/bin/tar: Exiting with failure status due to previous errors
Uncompressed /home/user/.cpan/sources/authors/id/D/DA/DAGOLDEN/HTTP-Tiny-0.082.tar.gz successfully
Using Tar:/usr/bin/tar xf "HTTP-Tiny-0.082.tar":
Untarred HTTP-Tiny-0.082.tar successfully
'YAML' not installed, will not store persistent state
Package contains both files[HTTP-Tiny-0.082.tar] and directories[HTTP-Tiny-0.082]; not recognized as a perl package, giving up
Configuring D/DA/DAGOLDEN/HTTP-Tiny-0.082.tar.gz with Makefile.PL
Running make for D/DA/DAGOLDEN/HTTP-Tiny-0.082.tar.gz
make: *** No targets specified and no makefile found.  Stop.
  DAGOLDEN/HTTP-Tiny-0.082.tar.gz
  /usr/bin/make -- NOT OK

I am really suck on how to fix this, I have been scratching my head for a few days now and any assistance would be really appreciated.

CodePudding user response:

Based on the log it seems to be an issue specifically with Ubuntu 22.04 on WSL1:

sh: 1: gzip: Exec format error

see: gzip from Ubuntu Jammy doesn't execute #8219

You could install an earlier version of gzip via. apt that works well – however the best route would be to update to WSL 2, as it has many benefits and it won't have this issue.

See the comparison page including some rare cases where you might want to stay on WSL 1.

  • Related