Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unzip command says file is corrupt but isn't. How to unzip on ubuntu?

Tags:

ubuntu

unzip

I have a large zip file which I need to unzip on ubuntu. (~6GB)

The standard unzip command fails, saying the file is corrupt. This happens on both OSX and Ubuntu.

I can successfully unzip the file by a) double-clicking with finder on osx b) ditto -V -x -k --rsrc myfile.zip . on the command line on osx.

Any ideas for how I can get this unziped this on ubuntu? And any ideas what the underlying issue is?

The error message when running unzip on both OSX and Ubuntu is:

Archive: myfile.zip warning [myfile.zip]: 1768583893 extra bytes at beginning or within zipfile (attempting to process anyway) error [myfile.zip]: start of central directory not found; zipfile corrupt. (please check that you have transferred or created the zipfile in the appropriate BINARY mode and that you have compiled UnZip properly)

Edit: Surprisingly unzip seems to be very unstable for large files! Java did the trick. Many others with the same issue:

  • https://serverfault.com/questions/235139/how-to-unzip-files-bigger-than-4gb/434537
  • https://serverfault.com/questions/530114/are-there-other-options-to-unzip-a-file-in-ubuntu-besides-unzip?rq=1
like image 344
python1981 Avatar asked Sep 14 '25 04:09

python1981


1 Answers

If you've got Java on the box, you can use :

jar xf test.zip

For more info look at https://serverfault.com/questions/235139/how-to-unzip-files-bigger-than-4gb/434537

like image 169
piyushj Avatar answered Sep 15 '25 21:09

piyushj