I've a corrupt zip file. I've tried to repair it with

zip -F file.zip

and

zip -FF file.zip

but was not successful. Is there another terminal tool under Linux for repairing?

link|improve this question

50% accept rate
Maybe the file is FUBR? – LiraNuna Aug 30 '09 at 1:30
feedback

migrated from stackoverflow.com Aug 16 '09 at 0:41

This question came from our site for professional and enthusiast programmers.

4 Answers

DiskInternals ZIP Repair works perfectly under Wine it's saved me in the past.

link|improve this answer
You can also just extract the actual executable from the installer using 7-Zip. Works like a charm. – Goyuix Sep 25 '10 at 15:46
feedback

I'm not aware of a program that will do a better job repairing the archive though.

You might try

unzip -vt file.zip

just to see if maybe you can extract some of the files safely, or figure out which files in the archive are corrupt.

link|improve this answer
thanks for the hint, but i get the same result as with "zip -F" :( – Sirakov Aug 13 '09 at 21:33
feedback

try this

zip -FF Corrupted.zip --out New.zip

This will scan the corrupted zip archive and make a new one eliminating the errors.

As a result you will get a new zip file. Then simply run this command.

unzip New.zip

Hope this helps.

link|improve this answer
feedback

I have a 4.1GB zip that couldn't be opened/extracted. I already tried the Windows version of 7zip with Wine. It said "Unsupported Method" and all files it extracted were empty. Then installed "p7zip-full" and the same result... The zip is created on Mac OS X (Can't be opened there either).

~/largezip$ unzip file.zip 
Archive:  file.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 file.zip or
        file.zip.zip, and cannot find file.zip.ZIP, period.
~/largezip$ unzip -vt file.zip
Archive:  file.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 file.zip or
        file.zip.zip, and cannot find file.zip.ZIP, period.
~/largezip$ zip file.zip 
    zip warning: missing end signature--probably not a zip file (did you
    zip warning: remember to use binary mode when you transferred it?)
    zip warning: (if you are trying to read a damaged archive try -F)

zip error: Zip file structure invalid (file.zip)
~/largezip$ zip -F file.zip --out 2.zip
Fix archive (-F) - assume mostly intact archive
    zip warning: bad archive - missing end signature
    zip warning: (If downloaded, was binary mode used?  If not, the
    zip warning:  archive may be scrambled and not recoverable)
    zip warning: Can't use -F to fix (try -FF)

zip error: Zip file structure invalid (file.zip)
~/largezip$ zip -FF file.zip --out 2.zip
Fix archive (-FF) - salvage what can
    zip warning: Missing end (EOCDR) signature - either this archive
                     is not readable or the end is damaged
Is this a single-disk archive?  (y/n): y
  Assuming single-disk archive

After it had run I could extract some of the output:

~/largezip$ unzip 2.zip 
Archive:  2.zip
warning [2.zip]:  136245456 extra bytes at beginning or within zipfile
  (attempting to process anyway)
file #1:  bad zipfile offset (local header sig):  136245456
  (attempting to re-compensate)

after it extracted some of the archive (folder properties says "2010 items, totalling 3.7 GB") it returned

error:  zipfile read error

I am running 64bit Crunchbang Linux

cat /etc/debian_version
6.0.4

cat /proc/version
Linux version 2.6.32-5-amd64 (Debian 2.6.32-41squeeze2) (dannf@debian.org) (gcc version 4.3.5 (Debian 4.3.5-4) ) #1 SMP Thu Mar 22 17:26:33 UTC 2012

Any ideas how to get more data out of it?

link|improve this answer
The zip file probably got truncated, or somehow the end got garbled or overwritten. There is generally enough info with each individual file inside to extract them, and you apparently did that. I'd say be thankful for what you got. (If you really want to dig further, study up on the format -- PKZIP has it on the web -- and use a hex editor to examine the file.) – DanH Apr 6 at 11:56
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.