Not enough disk space to unzip 50 GB file on Ubuntu 16.04: Can I extract and reduce zip file size at the same time

7-zipgziphard drivezip

I have a 50 GB zip file, which contains roughly 50.000 jpg images. The jpgs are, unzipped, around 55 GB. I am on Ubuntu 16.04.

But I only have 70 GB disk size on that system. So I get a disk error in the middle of the unzipping.

Can I unzip the file, and at the same time reduce the zip file size (e.g. delete the data of the jpgs which have already been unzipped), so that all fits on my disk?

— Same question for Windows exists —

Someone had the exact same question for Windows: unzip file on small drive

The proposed solutions there do unfortunately not solve the problem for me on Linux (and neither seem to solve the problem well on Windows). So I am keeping this question, in case there is a good solution for Linux. Thanks for the comments.

Best Answer

You can use GNOME's built-in Archive Manager to open the zip file without extracting. Once you've opened it you can copy ~10-15 GB of files to the folder you want them extracted to, and then delete them from the archive. Rinse and repeat.

There are multiple utilities which have this functionality (Archive-Mounter, archivemount, GVFS, AVFS) but Archive Manager has a very convenient GUI and will probably be the easiest to use.

Alternatively, you could attach an external drive and use it as temporary storage.

Side note: Windows has the ability to mount zip files like this built-in, I'm surprised no one pointed this out in the other thread.