18

I am unzipping a file with approximately 3 million single text files - the zip-file itself is around 12 GB in size. It's not multi-part - it's just one large zip file btw. I do not have the original data - all I have is the zipped file which means I cannot try to zip the content again (just so you know).

The problem is that as I unzip, at some point, I get

..
file #1207565:  bad zipfile offset (local header sig):  9570252890
file #1207566:  bad zipfile offset (local header sig):  9570254437
file #1207567:  bad zipfile offset (local header sig):  9570255044
file #1207568:  bad zipfile offset (local header sig):  9570256141
file #1207569:  bad zipfile offset (local header sig):  9570256786
file #1207570:  bad zipfile offset (local header sig):  9570257539
..

This does not seem to affect every subfolder or file respectively in the archive but for a lot of them the process seems to fail.

At this point it's hard for me to guess if the packing or the unpacking is the problem

Are there any workarounds I could try on my side?

  • 4
    Suggestion online and via man pages is to use: zip -F original.zip --out fixed.zip and then try to extract fixed.zip as normal... – andrew.46 Apr 17 '18 at 09:10
  • 1
    @andrew.46 On it - although I had to "try harder" using -FF in order to make it run at all - what I can see though are warning and things like "skipping this signature .." - I guess that means those files are not going to make it into fixed.zip? – Stefan Falk Apr 17 '18 at 10:22
  • 1
    @andrew.46 Okay, I tried it twice - unfortunately this does not work. It ends up with the same error messages. :/ – Stefan Falk Apr 17 '18 at 10:28
  • 1
    NB: macOS can create these problem zips - https://stackoverflow.com/a/59518097/2732969 . – Anon Dec 29 '19 at 09:13

2 Answers2

18

I ran into the same problem - a huge zip file with a lot of files - and unzip choked trying to unpack it. A possible solution is to use java archiver. Just unpack your stuff with jar xvf file.zip

Daria
  • 375
6

I just wanted to copy the comment into an answer, although I had to use the "try harder" -FF option to get it to work:

Suggestion online and via man pages is to use: zip -F original.zip --out fixed.zip and then try to extract fixed.zip as normal...

Azor Ahai -him-
  • 171
  • 1
  • 5