当我试图在Windows 10上运行的Ubuntu上安装Perl模块时遇到问题。我不确定发布输出的最佳方式,我猜可能是“代码”
$ 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
我真的很吸在如何解决这个问题,我一直在挠头几天了,现在和任何援助将真的很感激。
1条答案
按热度按时间wlwcrazw1#
根据日志,这似乎是WSL 1上的Ubuntu 22.04特有的问题:
sh: 1: gzip: Exec format error
请参阅:gzip from Ubuntu Jammy doesn't execute #8219
您可以通过运行良好的.
apt
安装gzip
的早期版本-然而,最好的方法是更新到WSL 2,因为它有很多好处,而且不会有这个问题。请参阅comparison page,其中包括一些您可能希望保留WSL 1的罕见情况。