Error while unzipping a file in shell script. - need PK compat. v5.1 (can do v4.6)

Use 7z from p7zip-full package in Debian:

$ 7z x test.zip


You can use p7zip to perform the required action. Use brew to install it.

$ brew install p7zip

use this to unzip a file

$ 7z x file.zip

I think it is "normal" that info-zip's unzip6.0 can only work with ZIP Entries which use the 4.6 version. This describes the features needed to uncompress it. The latest addition in unzip 6.0 is bzip2, which is represented in version 4.6. The 5.1 version you get when you use the (AES) strong encryption feature.

You need to use alternative tools like the mentioned 7zip (or the commercial pkunzip) to unpack those files. When you can influence the creation process, then play around with the features you use and which not (i.e. do not ask for strong password encryption if you want to be compatible with legacy infozip tool).

And yes, this is somewhat unfortunate. And I think the unzip is ported to so many target platforms, that nobody wants to work on it anymore .)