52

I received a zip file from a bank. I get the following error when I trying to unzip it.

unzip filename.zip 
Archive:  filename.zip
   skipping: SOME_STUFF.pdf  need PK compat. v6.1 (can do v4.6)

The file command returns

Zip archive data

for this file.

There are a fair number of threads containing this error message, but the only concrete suggestions they have is to use 7z x or 7za x from the p7zip-full package. These fail with the error:

Unsupported Method

Sub items Errors: 1

I'm using Debian wheezy amd64. I don't see significant updates of the unzip or 7za packages in testing/unstable though.

I'd appreciate suggestions of how to unzip this file, and more generally, what does the error message PK compat. v6.1 (can do v4.6) mean? For a widely used utility, zip does not have much documentation available about it. The README in the Debian sources points to http://www.info-zip.org/pub/infozip/ which lists a release dated of 29th April 2009 for UnZip 6.0.

Here is the version output for the unzip binary on my system.

unzip -v
UnZip 6.00 of 20 April 2009, by Debian. Original by Info-ZIP.

Latest sources and executables are at ftp://ftp.info-zip.org/pub/infozip/ ;
see ftp://ftp.info-zip.org/pub/infozip/UnZip.html for other sites.

Compiled with gcc 4.7.2 for Unix (Linux ELF) on Feb  3 2015.

UnZip special compilation options:
        ACORN_FTYPE_NFS
        COPYRIGHT_CLEAN (PKZIP 0.9x unreducing method not supported)
        SET_DIR_ATTRIB
        SYMLINKS (symbolic links supported, if RTL and file system permit)
        TIMESTAMP
        UNIXBACKUP
        USE_EF_UT_TIME
        USE_UNSHRINK (PKZIP/Zip 1.x unshrinking method supported)
        USE_DEFLATE64 (PKZIP 4.x Deflate64(tm) supported)
        UNICODE_SUPPORT [wide-chars, char coding: UTF-8] (handle UTF-8 paths)
        LARGE_FILE_SUPPORT (large files over 2 GiB supported)
        ZIP64_SUPPORT (archives using Zip64 for large files supported)
        USE_BZIP2 (PKZIP 4.6+, using bzip2 lib version 1.0.6, 6-Sept-2010)
        VMS_TEXT_CONV
        WILD_STOP_AT_DIR
        [decryption, version 2.11 of 05 Jan 2007]

UnZip and ZipInfo environment options:
           UNZIP:  [none]
        UNZIPOPT:  [none]
         ZIPINFO:  [none]
      ZIPINFOOPT:  [none]

dpkg reports the package version as 6.0-8+deb7u2.

The output of zipinfo is:

zipinfo filename.zip 
Archive:  filename.zip
Zip file size: 6880 bytes, number of entries: 1
-rw-a--     6.4 fat    10132 Bx defN 15-Feb-06 16:24 SOME_STUFF.pdf
1 file, 10132 bytes uncompressed, 6568 bytes compressed:  35.2%
1
  • I came across this bug report that suggest to install p7zip-rar on Debian in case you get the 7z error that you got.
    – Anthon
    Apr 30, 2017 at 6:53

5 Answers 5

66

Origin of the error

The PK in the error stands for Phil Katz, the inventor of the original PKZIP format. The zip utility has not kept up with the capabilities of the pkzip derived commercial software, particularly the certificate storage that banks like to include in their ZIP files.

Wikipedia gives an overview of the development of the format. But the Unix zip utilities don't implement the changes after the year 2002.

You might have to buy the PKWARE commercial version for Linux to uncompress this.

The man page for zip has the following to say for itself and unzip:

   A  companion  program  (unzip(1))  unpacks  zip  archives.  The zip and
   unzip(1) programs can work with archives produced by PKZIP  (supporting
   most PKZIP features up to PKZIP version 4.6), and PKZIP and PKUNZIP can
   work with archives produced  by  zip  (with  some  exceptions,  notably
   streamed  archives,  but  recent  changes  in the zip file standard may
   facilitate better compatibility).  zip version 3.0 is  compatible  with
   PKZIP  2.04  and  also supports the Zip64 extensions of PKZIP 4.5 which
   allow archives as well as files to exceed the previous 2 GB limit (4 GB
   in  some  cases).  zip also now supports bzip2 compression if the bzip2
   library is included when zip is compiled.  Note that PKUNZIP 1.10  can‐
   not extract files produced by PKZIP 2.04 or zip 3.0. You must use PKUN‐
   ZIP 2.04g or unzip 5.0p1 (or later versions) to extract them.

Solution

Although zip cannot do the job there are other tools that can. You mention the 7zip utility and the Linux/Unix commandline version of 7-Zip that, among others can read and write ZIP format. It claims that if 7-Zip cannot read a zip file, that in 99% of the cases the file is broken. 7-Zip utilities should be able to read your file, so either it is broken or else yours are in the 1% (for which I found no further details).

7-zip on Linux comes in various executables with different format support. The most basic ( 7zr ), doesn't support ZIP, you should use at least 7za or the full-fledged 7z:

7za x filename.zip

Different Linux version package 7za/7z in packages with different names.

The most easy (as so often) is installing on Solus:

sudo eopkg install p7zip

On Debian derived Linux version, the package p7zip only installs the base 7z that doesn't support ZIP. This split-up has caused some problems and installing p7zip-full doesn't do what it says, sometimes you also have to install p7zip-rar On my Linux Mint system I needed to do:

sudo apt-get install p7zip-full p7zip-rar

On RedHat/CentOS you need to have the EPEL repository enabled. E.g on CentOS 7 I needed to do:

sudo yum install epel-release
sudo yum --enablerepo=epel install p7zip
4
  • Thanks, Anthon, that's very informative. Do you know why the zip utility has not kept up? On a related note, is there any password protected method of transmission that I could tell my bank to use that might have a shot at working on a Linux based system without using proprietary software? Feb 7, 2015 at 7:52
  • @FaheemMitha My guess is that pkware wanted to earn more money and is not disclosing the details of the newer formats nor publishing the code as open source. I don't think your bank is going to change just for you, I had problems for several years with slightly non-conform PDF files that evince could not read and I ended up firing up my WinXP VM to do so.
    – Anthon
    Feb 7, 2015 at 8:01
  • I don't expect my bank to do anything just for me. :-) But I thought if there was some alternative method available, they might consider using it. In this case, this zipped file was not sent to me via some automated method. It was sent to me by a person at my request. Feb 7, 2015 at 9:36
  • The ZIP format as specified in the "APPNOTES" file is docuemnted by PKWare openly. @Anthon
    – eckes
    Feb 7, 2015 at 15:05
14

I ran in to the same problem except with PK compat. v6.3. Solved it by extracting the archive with the 7-zip POSIX version.

Arch Linux package: p7zip.

1
  • 2
    Using 7zip was the best option for me. i.e. 7z x archive.zip
    – hookenz
    Dec 22, 2016 at 21:41
9

I ran into the exact same error code (need PK compat. v6.1) while trying to unzip a zip file with the default MacOS unzipper.

I tried the p7zip and got kind of deep into it before checking the App Store.

In the App Store, I found a free unzipper app called "Unarchiver" (the first search result as of this writing) and it successfully unzipped the file without any problems.

For Mac users, I'd suggest using that free "Unarchiver" program.

7
  • That's not going to help the OP, here, who is using Debian...
    – Jeff Schaller
    Jan 29, 2019 at 4:10
  • 3
    @JeffSchaller The OP has long since moved on. :-) And I'm ok with a Mac answer, even if it doesn't directly answer the question. Maybe it will be useful to someone. Jan 29, 2019 at 4:12
  • 4
    @JeffSchaller Well, if someone googles the error message, they are likely to stumble on this question. Jan 29, 2019 at 8:17
  • 2
    I agree, we should remember that SO is useful also for questions similar to the original one, it would actually be worse if there was a question like this one for each different OS... Dec 11, 2019 at 10:35
  • 1
    For macports users, port install p7zip installs the 7z, 7za, 7zr executables, which can be useful here
    – mabraham
    Mar 5, 2020 at 9:05
1

I got (Ubuntu 22.04.1 LTS):

need PK compat. v6.3 (can do v4.6)

And was able to extract the file using Python's unzip library:

import zipfile
with zipfile.ZipFile('EPD_202209.ZIP', 'r') as zip_ref:
    zip_ref.extractall('.')
0

My bank also uses a legacy commercial licenced version of WinZip (PKZIP) with a password, and I am unable to unzip their encrypted zip file in Linux.

need PK compat. v6.1 (can do v4.6)

Unfortunately the 7z (p7zip) solution mentioned in other answers didn't work.

ERROR: Unsupported Method :

I am able to start a Windows 10 virtual machine (libvirt QEMU/KVM), and from there download and use a legacy version of WinZip https://www.winzip.com/en/download/legacy/ for example, winzip90.exe WinZip 9.0 SR-1 worked for my encrypted files.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .