centos解压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….

问题现象

从虚拟机中拖放传输的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.

图片[1] - centos解压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…. - 正则时光

原因分析

这种涉及文件传输的经常遇到传输后,文件不一致问题。可以首先查看前后文件是否一致。

linux中查看md5值

md5sum 文件路径
图片[2] - centos解压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…. - 正则时光

windows中查看md5值

#在powershell中使用管理员身份
 Get-FileHash -Algorithm MD5 -Path 文件路径
图片[3] - centos解压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…. - 正则时光

解决办法

使用带有错误检查功能的传输工具(如winscp),或带有校验和功能的命令(例如 rsyncscp),以确保文件传输的完整性。

图片[4] - centos解压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…. - 正则时光

使用带有完整性校验的工具和命令传输文件后,再来检测文件md5值可以看到与原文件一致。并且此时解压成功!

图片[5] - centos解压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…. - 正则时光
© 版权声明
THE END
喜欢就支持一下吧
点赞5 分享