I am getting the following error when unzipping a file

unzip user_file_batch1.csv.zip

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

I believe this file is not corrupted or a part of multi archive file as using Archive Utility I was able to unzip it. I have tried to rename it to .zip but did not work.

The output of type file user_file_batch1.csv.zip was

user_file_batch1.csv.zip: uuencoded or xxencoded text
  • 3
    type file user_file_batch1.csv.zip — tell us what the output is. – ctrl-alt-delor Jun 13 '14 at 16:47
  • The output was user_file_batch1.csv.zip: uuencoded or xxencoded text – user1711845 Jun 13 '14 at 19:14
  • 1
    It is not a zip, you need to uudecode it. Then use file to see what you have. (Look at @giles's answer). – ctrl-alt-delor Jun 16 '14 at 8:42
up vote 15 down vote accepted

Your file has a .zip name, but is not in zip format. Renaming a file doesn't change its content, and in particular doesn't magically transform it into a different format.

(Alternatively, the same error could happen with an incomplete zip file — but since that Archive Utility worked, this isn't the case.)

Run file user_file_batch1.csv.zip to see what type of file this is. It's presumably some other type of archive that Archive Utility understands.

user_file_batch1.csv.zip: uuencoded or xxencoded text

Run the following command:

uudecode user_file_batch1.csv.zip

This creates a file whose name is indicated in user_file_batch1.csv.zip. If you want to pick a different output file name:

uudecode -o user_file_batch1.csv.decoded user_file_batch1.csv.zip

The output file at this stage may, itself, be an archive. (Perhaps it's a zip, in fact.) Run the file utility again on this file to see what it is. If you choose the automatic file name, it might give a clue.

  • On Mac, file /users/an/zz.zip says """Zip archive data, at least v1.0 to extract""". But trying to unzip, it says """Archive: /users/an/zz.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. Archive: /users/an/zz.ZIP End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes – Pacerier Nov 26 '17 at 16:49
  • 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.""" – Pacerier Nov 26 '17 at 16:49
  • @Pacerier So? It's either a damaged zip, or a zip that uses some feature that your version of unzip doesn't support, or a part of a multi-part zip, or something that was never meant to be a zip but happens to look like one superficially. It's impossible to tell without knowing what's in the file. – Gilles Nov 26 '17 at 20:13

I had a similar problem when doing unzip archive.zip, giving me

Archive: archive.zip
warning [archive.zip]: ... extra bytes at beginning or within zipfile
(attempting to process anyway)
error [archive.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)

Doing file archive.zip gave me

Zip archive data

Using 7z e archive.zip worked.

  • This isn't the answer to the OP, but it IS the answer to mine :) Thanks, I didn't know that 7zip was available in Linux. – Morlock May 25 '17 at 13:34

Go to your zip location then unzip by this command

jar xvf yourzipfile.zip
  • My sqlworkbench zip file was corrupted due to improper shutdown. This helped me to recover at least 6 tabs out of 9. Thanks. – jimy Oct 13 '17 at 6:34

I had the same problem with unzip.

Then I tried to extract it with 7z and jar without any luck. Later it turned out that the it was a quiet old p7zip version.

I installed a new one from source and that solved the issue. A simple:

7z x archive.zip

extracted it out correctly.

if you want to copy the text content in the zip file just gzip the file for file format and for listing the content use zcat

# unzip ADUReport.zip
Archive:  ADUReport.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 ADUReport.zip or
        ADUReport.zip.zip, and cannot find ADUReport.zip.ZIP, period.
 #gunzip ADUReport.zip
gunzip: ADUReport.zip: unknown suffix -- ignored
 zcat ADUReport.zip

#zcat: ADUReport.zip: not in gzip format
#gzip ADUReport.zip
#l
 #zcat ADUReport.zip.gz
  • Apart from that this doesn't answer the OPs question, explaining why gzip-ping a file and then zcat-ting instead of using cat on the original file helps (unless you are paid by the hour). – Anthon Feb 16 '16 at 8:22

If it was a 7zip archive you can try installing 7zip.

http://ask.xmodulo.com/install-7zip-linux.html

  • This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review – Jeff Schaller Sep 19 '16 at 0:55
  • Oh sorry. Yeah if you've run into this problem before. It actually can be the answer. 7zip on windows "at least" builds their archives not to the spec "zip" on linux expects. Using 7zip linux binary allows you to unzip the file without issue. The reason I even posted this, is because I ran into this exact issue some minutes before and came here to post the solution. Cheers! Not sure why I don't have reputation here.. is the unix sub domain completely different from the main one? – Sacha Griffin Sep 20 '16 at 15:06

I have this problem after I renamed the zipped file.

Solutions:

  1. Rename to original name back

  2. Use other unpack tools (jar, 7z, gunzip, fastjar, etc.)

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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