使用curl下载protoc压缩包后执行unzip命令失败的问题排查
问题:curl下载protoc压缩包后unzip解压失败
环境:Macbook Pro(macOS Big Sur 11.6.8),正在学习Golang结合gRPC的使用,按照《Protocol Buffer Compiler Installation》页面指引执行以下命令:
curl -LO https://github.com/protocolbuffers/protobuf/releases/protoc-21.4-osx-universal_binary.zip unzip protoc-21.4-osx-universal_binary.zip -d /Users/rodrigosilveira/.local
执行unzip命令时失败,报错信息如下:
Archive: protoc-21.4-osx-universal_binary.zip End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive. unzip: cannot find zipfile directory in one of protoc-21.4-osx-universal_binary.zip or protoc-21.4-osx-universal_binary.zip.zip, and cannot find protoc-21.4-osx-universal_binary.zip.ZIP, period.
调试说明
- 手动下载后解压正常
- 访问《Protocol Buffers v21.4》页面
- 点击下载
protoc-21.4-osx-universal_binary.zip文件 - 在本地Downloads文件夹中使用
unzip解压该压缩包可成功
- Stack Overflow相关回答无法解决问题
- 已查阅多个相关Stack Overflow问题,但均未解决当前问题
内容的提问来源于stack exchange,提问作者Rodrigo Silveira
相关产品推荐
相关产品推荐

