加入空分之家 登录
空分之家 返回首页

李杰春的个人空间 https://bbs.kongfen.org.cn/?52 [收藏] [复制] [分享] [RSS]

日志

cannot find zipfile directory( unzip .zip 文件出错)

已有 1270 次阅读2013-9-13 07:20 |个人分类:互联网

Linux 下 unzip .zip 文件出错

尝试 unzip wget 过来的压缩文件:

unzip uploads.zip

提示如下错误:

Archive: bbs.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 uploads.zip or uploads.zip.zip, and cannot find uploads.zip.ZIP, period.

刚开始以为是 wget 过程中因为超时续传导致文件部分信息丢失,就很傻很天真的重新下了一次,2.5G 啊,真够可以的。
结果你知道的,仍然是同样或类似的错误(什么签名没找到,什么文件头信息,文件尾信息等等)。

哦,等等,2.5G,是不是文件太大了?
Google 之,发现有人说:

一般在linux下解压zip文件,直接用系统默认的extract here就可以进行解压。
(默认使用的是 unzip)

可是如果压缩文件.zip是大于2G的,那unzip就无法使用了。这是由于C库中long类型数据所能表示的文件偏移在32位机子上只能有2G。

所以如果要解压大文件,需要使用7zip。

CentOS 下安装7-Zip

在SHH或者终端下输入:yum –y install p7zip(如果提示找不到资源,则要自己下载编译安装,命令如:)

wget http://nchc.dl.sourceforge.net/sourceforge/p7zip/p7zip_4.65_src_all.tar.bz2

tar -xjvf p7zip_4.65_src_all.tar.bz2

cd p7zip_4.65

make && make install

看到如下信息就说明你安装成功了:

./install.sh /usr/local/bin /usr/local/lib/p7zip /usr/local/man /usr/local/share/doc/p7zip

- installing /usr/local/bin/7za

- installing /usr/local/man/man1/7z.1

- installing /usr/local/man/man1/7za.1

- installing /usr/local/man/man1/7zr.1

- installing /usr/local/share/doc/p7zip/README

- installing /usr/local/share/doc/p7zip/ChangeLog

- installing HTML help in /usr/local/share/doc/p7zip/DOCS

这时如果发现乱码,请执行命令export LANG=zh_CN.GBK

常用命令:

7za e ishagua.7z   解压到当前目录下,不保留原来的目录结构

7za x ishagua.7z   解压到当前目录下,但保留原来的目录结构

那么原来的zip压缩文件解压就是:

7za x uploads.zip

搞定!

 已同步至 李杰春的微博

路过

雷人

握手

鲜花

鸡蛋

评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 加入空分之家

客服中心

帮助文档|清除痕迹|广告位|Archiver|手机版|小黑屋|空分之家 ( 鲁ICP备10016836 )

GMT+8, 2024-7-4 17:17 , Processed in 0.063182 second(s), 20 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部