unzip: cannot find zipfile directory in one of。。。unzip解压失败(转载)

[root@hdss1-200 ~]# unzip -o apollo-configservice-1.5.1-github.zip
Archive:  apollo-configservice-1.5.1-github.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 apollo-configservice-1.5.1-github.zip or
        apollo-configservice-1.5.1-github.zip.zip, and cannot find apollo-configservice-1.5.1-github.zip.ZIP, period.

在centos7上部署apollo时,解压apollo-configservice-1.5.1-github.zip遇到上述报错,于是在window主机上尝试解压,发现正常解压,说明源文件正常,百度说 “一般在linux下解压zip文件,直接用系统默认的extract here进行解压(默认使用的是 unzip)
如果压缩文件.zip是大于2G的,那unzip就无法使用了,这是由于C库中long类型数据所能表示的文件偏移在32位机子上只能有2G”,但是我的包只有52M左右啊
 

[root@hdss1-200 ~]# ll
total 113168
-rw-------. 1 root root     1325 Jun 27  2020 anaconda-ks.cfg
-rw-r--r--  1 root root 51868604 Mar 25 07:00 apollo-adminservice-1.4.0-github.zip

于是尝试着将文件重新压缩,上传,unzip解压,奇迹来了,居然解压成功了。(包解压完是59M,重新压缩成zip包后,居然有105M,对压缩机制不了解,有大佬了解的,还望赐教)

转载:https://blog.csdn.net/weixin_41557069/article/details/115223217

你可能感兴趣的:(demo,zip,gzip)