terminal tool (linux) for repair corrupted zip files

109,096

Solution 1

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.

Solution 2

Just referenced this question in my answer to a similar one - Linux Mint 12 - how to open a .zip file in terminal

It is worth adding here what the zip manual currently says about the difference between -F and -FF:

The single -F is more reliable if the archive is not too much damaged, so try this option first.

So the first attempt would be:

zip -F broken.zip --out fixed.zip
unzip fixed.zip

And if that doesn't work:

zip -FF broken.zip --out fixed.zip
unzip fixed.zip

Solution 3

I recently encountered a .zip file that neither zip -F file.zip nor zip -FF file.zip could fix. However,

7z x file.zip

was able to extract all the files. Hence, trying out p7zip could be a good idea. If needed, you can then pack the extracted files into a new archive.

Solution 4

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

Solution 5

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.

Share:
109,096

Related videos on Youtube

cupakob
Author by

cupakob

no info about me :)

Updated on September 17, 2022

Comments

  • cupakob
    cupakob over 1 year

    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?

    • polson136
      polson136 over 14 years
      Maybe the file is FUBR?
  • Admin
    Admin over 14 years
    thanks for the hint, but i get the same result as with "zip -F" :(
  • Goyuix
    Goyuix over 13 years
    You can also just extract the actual executable from the installer using 7-Zip. Works like a charm.
  • Rein
    Rein over 7 years
    Thanks for this answer. Doing it this way didn't really give me a working zip-file, running the command again over the new zip file did do the trick. It was a desperate move, didn't expect it to work.
  • dance2die
    dance2die almost 4 years
    Worked great on Ubuntu 20.04 LTS~ Context: my zip was created on Windows 10, uploaded to OneDrive, and downloaded in Ubuntu. Zip worked on Windows but not on Ubuntu but the answer fixed the issue.
  • xd1936
    xd1936 over 3 years
    Saved the day, Ubuntu 20.04. Thanks!
  • holocronweaver
    holocronweaver about 2 years
    This worked for me when unzipping an archive created on Windows, where zip was unable to recognize the beginning of the file and gave up, while 7z reported Header errors and then proceeded to extract the 11 GB+ zip successfully.
  • Admin
    Admin almost 2 years
    Worked great on partial zip archive.