How to Open a Zip File That Turns Into a CPGZ

Feb 13, 2013 - 68 Comments

Zip to CPGZ loop

Ever had a zip file turn into a cpgz file? This is an infrequent problem, but here’s what happens; When the .zip file is attempted to be unzipped, it extracts into a .cpgz file, which then can also be launched in Archive Utility, only to then turn back into a .zip file, which then turns into a .zip.cpgz file, and basically the archive gets stuck in an infinite loop as it’s being decompressed into one variation of the other, over and over again. Annoying, right? Not to worry, this tutorial will detail how to open a cpgz zip file on a Mac.

Why this happens isn’t always completely clear, but it can be indicative of a few things:

  • Corrupted file, either during download or from origin
  • Incomplete download, stopped at 99% done or similar
  • Certain web browsers mishandling a file during or after the download process
  • A bug

Accordingly, dealing with the zip cpgz loop is usually best handled in a few different ways. Before beginning, you may want to check the md5 hash or SHA1 of the origin file if possible, that can easily tell you if the file was corrupted or is incomplete. Nonetheless, not all servers provide you with either, so we’ll cover three ways to handle this CPGZ zip issue without that, and crack open that error prone zip archive once and for all.

1: Download the Zip File Again with a Different Browser

If you downloaded the original file with Firefox, try downloading the zip file again with Chrome or Safari, and vice versa. Sometimes it’s just a matter of redownloading the file again before it unzips normally. This is great for smaller files, but large downloads don’t always make sense to do this with, and if you know for sure the file isn’t corrupted because of checking md5/sha1 sums or otherwise, you can attempt two other options.

Downloading the original zip again often works to be able to open zip file properly on a Mac and Windows PC, without having to deal with the cpgz file.

2: Unzip the Zip CPGZ from the Command Line

The command line unzip tool is often able to break archives out of the .zip to .cpgz cycle. You can do the following with the original .zip archive to open the CPGZ on a Mac:

  • Launch Terminal, found in the /Applications/Utilities folder
  • Find the .zip file in the Finder and have it easily accessible
  • At the command line type “unzip ” followed by a space, then drag and drop the .cpgz or .zip file into the terminal window to automatically enter the full path to that file, then hit return
  • Unzip a file from the command line and GUI

  • The archive should expand as usual, giving you the contents

Forcibly unzipped zip file as done by the unzip command

The command line method should work basically every time, as it will forcibly extract even partially downloaded files. If you know the file is only partially downloaded though (by way of checking md5 hash or otherwise), you really ought to just download the file again.

3: Install & Use The Unarchiver to Open CPGZ Zip Files

The Unarchiver is a third party tool that can be thought of as a swiss army knife of compression formats, able to work with virtually any archive file format you can throw at it. It works in much the same way as the default Archive Utility, only running when an archive is encountered, which it quickly decompresses then quits again. As such, it can also be used to forcibly extract problematic zip/cpgz files:

  • Download The Unarchiver for Mac OS X and install it, make sure it associates with all archive formats
  • Open the problematic .zip or .cpgz file (generally focusing on the origin zip is best) through Unarchiver and let it decompress

The archives files should now be accessible as intended.

On a quick side note, with Archive Utility having some crashing problems lately, there has never been a better time do grab an alternative like The Unarchiver. It’s free, handles archives of just about any conceivable format, and is highly recommended.

This troubleshooting post comes in response to a question we recently got recently on Twitter (don’t forget to follow us there too), and, as luck would have it, I then encountered the same issue myself after downloading the mouse sharing app Teleport. For my purposes, I used the command line method, but Unarchiver was also confirmed to work just as well.

.

Related articles:

Posted by: Paul Horowitz in Mac OS, Tips & Tricks, Troubleshooting

68 Comments

» Comments RSS Feed

  1. Jon says:

    Thanks. None of these actually worked for me, but I did find a solution that worked in my particular case. When downloading the zip files I changed the download format in the drop-down menu from ‘Zip files’ to ‘All files’. Why this should do the trick I have no idea, but it’s worth a try if you’re out of other options.

  2. Yudum says:

    It was very helpful. Thank you!

  3. Fab says:

    Thanks a lot! Terminal helped me unzip the TheUnarchiver app.. then I could unzip the file I had to unzip at first in the Unarchiver. (Terminal would not work…)

    wow thanks to the community
    !!

  4. Kris says:

    Thank you for sharing this!! I was finally able to get my file open.

  5. Tanja says:

    Thank you! I’ve been trying to figure out this problem without success until I found this article. The Unarchiver didn’t work. Then I realised the file I was trying to extract had zero bytes. So I found another copy I had downloaded in the earlier step, which was over a gb. The Unarchiver was able to extract it where my mac simply couldn’t on its own. Thanks!

  6. It worked! Terminal totally solved this annoying issue. I just had to LOCATE the files (just do a quick search – they don’t appear on the desktop). Awesome. Thanks for the advice! Brenda

  7. Paola Ramirez says:

    This article saved my life. Thank you!

  8. Bloozman says:

    Just to add the the list: I was having this same problem using the archive utility:

    Surprisingly, even the terminal command approach failed, despite an “inflating” message which made it appear it may have worked. Indepently, I also tried a third party (like Derek Scott suggested above way back in 2013, but prior to reading his comment). In my case I tried Winzip for Mac free trial, and it worked beautifully! Nothing is as simple as advertised, in the world of electronics: hardware and software.

  9. Mario says:

    tl;dr In my case the file extension was .zip and the file was actually a RAR archive.

    The command “7z x Renamed.zip”, showed the following:

    Path = Renamed.zip
    Open WARNING: Can not open the file as [zip] archive
    Type = Rar

    As a test I also used the unrar command “unrar x renamed.zip” which worked.

    If you use brew you can install “unrar” and/or “p7zip”.

    I would recommend that if you do use the command line, to use 7-zip as it’s output is helpful when diagnosing issues with archives.

  10. Daniele says:

    You opened Pandora’s box!

  11. gaurav says:

    The unarchiver fix worked for me.

  12. Pratik Panchal says:

    Open a terminal

    Rename the offending file.zip to file.tar.gz
    mv file.zip file.tar.gz

    Use tar command to untar it
    tar xvzf file.tar.gz

    This should correctly untar (unzip) the original file.zip file.

  13. newtoid says:

    In my case, I changed the file extension from .mysql.gz to sql and the file is fine, I guess it was never an archive in the first place.

  14. David Fraga says:

    Thanks for this tip! Unzipping via the terminal did the trick for me.

  15. Jennifer says:

    The Unarchiver did not unzip the cpgz file, but actually created yet another .zip file, and simply continued the cycle. Also, it does not appear in my applications folder, and I cannot locate it to delete it. Now it is set to unzip all my files – but will not unzip any files with the .zip extension! I get an error message that The Unarchiver cannot open this type of file. Any suggestions about how I can delete this app when it does not appear in my applications folder? Thank you.

  16. Courtney says:

    The second tip also didn’t work as I got this response in the launch terminal:
    “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.”
    It also stated it could not find a zipfile directory in this particular file.
    Any suggestions?

  17. Courtney says:

    This is a great tip but I have an older Macbook and the newest version of the Unarchiver does not work. Is there any way to download an earlier version that will work on my Mac OS X Version 10.6.8?

  18. Jaime Carrión says:

    Thanks for the tip! It helped me to export several sliders using LayerSlider for WordPress. Terminal says there was “1 extra byte at beginning or within zipfile”. But it unziped it anyways, once that was done I was able to create a zip easily!

  19. Ashish says:

    Thanks. unzipping from command line worked for me.

    Has anyone reported this to Apple?

  20. Bharat says:

    Thanks! Terminal did the job for me.

  21. Jared says:

    I was investigating this same issue and found that the Windows Server 2012 box that was generating the zip file was using version 4.5 of PK tools (remember pkzip/pkunzip?) whereas El Capitan only supports zip archives up to version 2.1. Unarchiver was the answer here since it incorporated newer tools.

  22. drojas says:

    Thanks! I pulled down the Unarchiver using brew cask (for mac), and it worked perfectly. :)

  23. Steve says:

    ditto -k -x worked for me.

  24. Demar says:

    tried in console, but also not working:

    unzip theFile.zip
    Archive: theFile.zip
    warning [theFile.zip]: zipfile claims to be last disk of a multi-part archive;
    attempting to process anyway, assuming all parts have been concatenated
    together in order. Expect “errors” and warnings…true multi-part support
    doesn’t exist yet (coming soon).
    error [theFile.zip]: missing 8526108894 bytes in zipfile
    (attempting to process anyway)
    error [theFile.zip]: attempt to seek before beginning of zipfile
    (please check that you have transferred or created the zipfile in the
    appropriate BINARY mode and that you have compiled UnZip properly)

  25. Tricia says:

    I just want to say a big THANK YOU. Suddenly had problems opening a zip file with archive utilities, spent hours on it, read this very informative article. Downloaded Unarchiver and solved the problem…

  26. Edaf says:

    I tried the Terminal workaround. It did fill in the name of the file after I dragged to the terminal window, but when I hit return, nothing seemed to happen. Where should the unzipped file be? It did not appear on the desktop or in the Terminal window. Should I look somewhere else?

  27. Jonathan says:

    Thank you! The terminal command was a short and sweet solution.

    It happens reliably when I create a .zip on a windows server, copy the file down to my mac via RDC (mapped drive). It only happens with one particular server, otherwise I use this method routinely with other win servers with no problems. The file is not corrupt as far as i can tell, or incompletely copied, some sort of bug or mismatch created by this sequence of events is responsible.

  28. Carl says:

    Thankyou thankyou thankyou!

  29. Adrian says:

    Thanks for this! I’ve been having this problem with files supplied by a client. The Unarchiver (free download) was able to unarchive the original .zip file first time. Thanks!

  30. Mike says:

    Firefox was the culprit. Thanks for the great advice.

  31. John says:

    I’d never encountered this problem before. Unarchiver worked.

    Thaks!!

  32. vivian says:

    Yay, thank you so much for sharing!

  33. This was super helpful! Thank you!

  34. Chris says:

    Very helpful! Thank you for the info!

  35. Vanita says:

    Thanks.
    its helpful

  36. dub says:

    You wouldn’t think there are differences in zip files between operating systems, but I think the reason I ran into this problem may have been because I was downloading a zip that was intended for windows except I was on a macintosh. I was downloading an internet explorer image for a virtual machine from modern IE. To be specific, I was downloading IE11.Win8.1.For.Windows.VirtualBox.zip I’m not going to download the whole 5 GB file again to test if that was the problem, but just note that perhaps you could run into this problem if you are using a zip file that is intended for a different operating system

  37. Stasw says:

    Great clearly written article. The unzip from command line option did the trick for me. Thank you!

  38. Deja says:

    THANK YOU!!! I was at a loss to know how to get out of the infinite loop. Downloading from another browser worked. Great tutorial!

  39. Miles says:

    I have an ongoing problem with this and was hopeful after reading this thread. I have OS X 10.10.3 and have tried many unarchivers, including the one listed above. The Unarchiver preferences won’t even allow me to select .zip file types. Ran terminal which ran a while and did not unzip the the file. Very frustrating, keep getting the .cpgz files created and no content.

    • htn says:

      If zip and Unarchiver won’t open the file it is probably corrupt and you would need to re-download it

  40. David says:

    Thank you! Terminal worked.

    FYI, in case others can’t find their uncompressed file/folder, mine showed up in the root of my user directory (alongside Applications, Documents, Pictures, etc).

    • Ashish says:

      That is because your terminal defaults in that folder. You can always get to the directory you want using cd command and then do the terminal method.

  41. thedoger82 says:

    I didnt any if the steos above, i opened it in windows with winrar, and it work normally

  42. sumit says:

    stuffit expander seems to work too..

  43. Jordan says:

    I get this error when trying to use terminal

    pcn:~ JordanLawrence$ unzip /Users/JordanLawrence/Downloads/Jordan.zip
    Archive: /Users/JordanLawrence/Downloads/Jordan.zip
    skipping: For Jordan.xls need PK compat. v5.1 (can do v2.1)
    pcn:~ JordanLawrence$

  44. It Worked! – The CPGZ loop threw me off for some time. After reading your advice I tried the terminal method and worked perfectly.

    Thanks!

  45. ffs says:

    new mac user here, jays us it worked! thank you!

  46. Lisa says:

    I just downloaded a file like this. The name of the file had no extension. When I added “.zip” to the end of the name, it unpacked normally when double-clicked. May be the easiest thing to try first.

  47. Harsh says:

    The inbuilt inflater ability of OSX does not recognise some of the modern formats of .zip packing, thereby causing this. The ‘unzip’ CLI tool may work sometimes, but otherwise one could also do a “brew install 7zip” and use “7za x ” to extract just about any format on the command line.

    The Unarchiver is a nice suggestion, thanks.

  48. Jeffcm says:

    I downloaded a 4 gb file several times, and tried two different browsers, safari and firefox. System 10.8.4 would NOT open it, even using Terminal. Terminal said the file was corrupt…

    I copied it via an external hard drive to my old 10.4.11 laptop, and that old system opened it up just fine! Copied the open folder back to the new laptop and everything installed perfectly.

  49. Lucas says:

    Terminal works thks! =D

  50. paymar says:

    any way to open zip files with spaces in file name..tried few attempts different software, but no luck

  51. Nina says:

    Thanks so much for this! Had a zip archive that was doing this but the Terminal work around solved it. You’re a life saver!

  52. Derek Scott says:

    I had this problem with a zip of mp3 files (Mac OS X and downloaded via Firefox). I went o the File menu, clicked on “Get Info” and then changed Open with: Archive Utility to Open with: Stuffit Expander.
    To my surprise it worked a treat. This seems to indicate that the files had downloaded OK, and the problem lies elsewhere.

  53. Joe says:

    This will also happen if someone mails you a link to a zip file in Dropbox, and you right-click on that link and ‘Save Link As’.
    Instead, click on the link, and download it from the Dropbox page that is displayed.

  54. Caleb Grove says:

    Thanks guys! I had a .zip file that was doing this to me, but The Unarchiver came to my rescue!

  55. sault says:

    It was high time someone talked about this problem. Well done.

Leave a Reply

 

Shop on Amazon.com and help support OSXDaily!

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Tips & Tricks

News

iPhone / iPad

Mac

Troubleshooting

Shop on Amazon to help support this site