尝试解压缩文件时出错:“需要 PK 兼容。v6.1(可以执行 v4.6)”

Fah*_*tha 39 zip

我从银行收到了一个 zip 文件。尝试解压缩时出现以下错误。

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

file命令返回

Zip archive data
Run Code Online (Sandbox Code Playgroud)

对于这个文件。

有相当多的线程包含此错误消息,但他们唯一的具体建议是使用7z x7za xp7zip-full包中。这些失败并出现错误:

Unsupported Method

Sub items Errors: 1
Run Code Online (Sandbox Code Playgroud)

我正在使用 Debian wheezy amd64。不过,我在测试/不稳定中没有看到unzip7za包的重大更新。

我很感激有关如何解压缩此文件的建议,更一般地说,错误消息PK compat. v6.1 (can do v4.6)是什么意思?对于广泛使用的实用程序,zip没有太多可用的文档。Debian 源代码中的 README 指向http://www.info-zip.org/pub/infozip/,其中列出了 2009 年 4 月 29 日发布的 UnZip 6.0。

这是unzip我系统上二进制文件的版本输出。

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]
Run Code Online (Sandbox Code Playgroud)

dpkg 将软件包版本报告为6.0-8+deb7u2.

的输出zipinfo是:

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%
Run Code Online (Sandbox Code Playgroud)

Ant*_*hon 48

错误的来源

错误中的 PK 代表 Phil Katz,他是原始 PKZIP 格式的发明者。该zip实用程序没有跟上pkzip衍生商业软件的功能,尤其是银行喜欢包含在其 ZIP 文件中的证书存储。

维基百科概述了格式的发展。但是 Unixzip实用程序在 2002 年之后不再实施这些更改。

您可能需要购买适用于 Linux的 PKWARE商业版本才能解压缩它。

手册页zip有以下内容可以说明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.
Run Code Online (Sandbox Code Playgroud)

解决方案

虽然zip不能完成这项工作,但还有其他工具可以。您提到了 7zip 实用程序和7-Zip的 Linux/Unix 命令行版本,其中包括可以读写ZIP格式。它声称,如果 7-Zip 无法读取 zip 文件,则在99% 的情况下该文件已损坏。7-Zip 实用程序应该能够读取您的文件,因此要么它已损坏,要么您的文件在 1% 之内(我没有找到更多详细信息)。

Linux 上的 7-zip 提供各种具有不同格式支持的可执行文件。最基本的 ( 7zr) 不支持 ZIP,您至少应该使用7za或完整的7z:

7za x filename.zip
Run Code Online (Sandbox Code Playgroud)

不同的 Linux 版本包7za/7z在不同名称的包中。

最简单的(经常)是在 Solus 上安装:

sudo eopkg install p7zip
Run Code Online (Sandbox Code Playgroud)

在 Debian 派生的 Linux 版本上,该软件包p7zip仅安装7z不支持 ZIP 的基础。这种分裂导致了一些问题,安装p7zip-full并没有按照它说的做,有时你还必须p7zip-rar在我的 Linux Mint 系统上安装我需要做的:

sudo apt-get install p7zip-full p7zip-rar
Run Code Online (Sandbox Code Playgroud)

在 RedHat/CentOS 上,您需要启用EPEL存储库。例如在 CentOS 7 上我需要做:

sudo yum install epel-release
sudo yum --enablerepo=epel install p7zip
Run Code Online (Sandbox Code Playgroud)


小智 11

我遇到了同样的问题,除了PK compat. v6.3. 通过使用 7-zip POSIX 版本解压缩存档解决了该问题。

Arch Linux 软件包:p7zip

  • 使用 7zip 对我来说是最好的选择。即`7z x archive.zip` (2认同)

小智 7

need PK compat. v6.1在尝试使用默认的 MacOS 解压缩器解压缩 zip 文件时遇到了完全相同的错误代码 ( )。

在检查 App Store 之前,我尝试了 p7zip 并对其进行了深入研究。

在 App Store 中,我找到了一个名为“Unarchiver”的免费解压缩应用程序(撰写本文时的第一个搜索结果),它成功地解压缩了文件,没有任何问题。

对于 Mac 用户,我建议使用免费的“Unarchiver”程序。

  • @JeffSchaller 好吧,如果有人用谷歌搜索错误消息,他们很可能会偶然发现这个问题。 (4认同)
  • @JeffSchaller OP 早就开始了。:-) 我对 Mac 的回答没问题,即使它没有直接回答问题。也许它会对某人有用。 (3认同)
  • 我同意,我们应该记住,SO 对于与原始问题类似的问题也很有用,如果每个不同的操作系统都有这样的问题,实际上会更糟...... (2认同)