在 macOS 上压缩的加密文件,放到 CentOS 上使用 unzip 进行解压缩的时候,会报错:
unzip unsupported compression method 99
原因是 macOS 上压缩的时候使用的Compression method 99
方法中中包括了 AES 加密算法,但是目前 unzip 还不支持这个加密标准。
可以使用 7zip
对文件进行解密:
- 7z x -pPASSWORD file.zip
- 解密是在命令行输入密码
- 7z x file.zip
- 如果文件加密了,会提示输入密码
1. 在 CentOS 中安装 7zip
下载如下两个文件:
- http://springdale.princeton.edu/data/springdale/7/x86_64/os/Addons/Packages/p7zip-16.02-10.sdl7.x86_64.rpm
- http://springdale.princeton.edu/data/springdale/7/x86_64/os/Addons/Packages/p7zip-plugins-16.02-10.sdl7.x86_64.rpm
然后安装:
yum insyall p7zip* -y
参考: - https://access.redhat.com/solutions/59700 - https://openwritings.net/pg/linux/unzip-error-unsupported-compression-method-99 - http://springdale.princeton.edu/data/springdale/7/x86_64/os/Addons/ - https://rhel.pkgs.org/7/springdale-addons-x86_64/p7zip-16.02-10.sdl7.x86_64.rpm.html - https://gist.github.com/P7h/9fcccc54596ad05764128dec6f6cf78d
2. 在 Ubuntu 中安装 7z
apt install -y p7zip-full
- 解压文件
7z e abc.7z