首页 > 系统 > Linux > 正文

Linux下解压超过4G的zip文件

2024-06-28 13:28:33
字体:
来源:转载
供稿:网友
linux下解压超过4G的zip文件 2014-01-09 11:52 by 潇湘隐者, ... 阅读, ... 评论, 收藏, 编辑

从Windows平台通过FTP上传一个大小约为6G的zip文件到Linux系统(Oracle Linux Server release 5.7)上,解压过程中出现如下错误:

   1: [root@gsp tmp]# unzip -n OracleLinuxandPataches.zip -d /u02/tmp
   2: error:  Zip file too big (greater than 4294959102 bytes)
   3: Archive:  OracleLinuxandPataches.zip
   4: warning [OracleLinuxandPataches.zip]:  2107863523 extra bytes at beginning or within zipfile
   5:   (attempting to PRocess anyway)
   6: error [OracleLinuxandPataches.zip]:  start of central directory not found;
   7:   zipfile corrupt.
   8:   (please check that you have transferred or created the zipfile in the
   9:   appropriate BINARY mode and that you have compiled UnZip properly)

                                                                                                 截图如下

                     clip_image001

从网上搜索了一下相关资料,发现是当前的unzip版本不支持4G以上的压缩包。要么升级到最新版本的unzip,要么使用7-Zip forLinux版本的的p7zip。

如下所示,当前的unzip版本为5.52

   1: [root@gsp database]# unzip -v
   2: UnZip 5.52 of 28 February 2005, by Info-ZIP.  Maintained by C. Spieler.  Send
   3: bug reports using http://www.info-zip.org/zip-bug.html; see README for details.
   4:  
   5: Latest sources and executables are at ftp://ftp.info-zip.org/pub/infozip/ ;
   6: see ftp://ftp.info-zip.org/pub/infozip/UnZip.html for other sites.
   7:  
   8: Compiled with gcc 4.1.2 20080704 (Red Hat 4.1.2-44) for Unix (Linux ELF) on Apr  8 2009.
   9:  
  10: UnZip special compilation options:
  11:         COPYRIGHT_CLEAN (PKZIP 0.9x unreducing method not supported)
  12:         SET_DIR_ATTRIB
  13:         TIMESTAMP
  14:         USE_EF_UT_TIME
  15:         USE_UNSHRINK (PKZIP/Zip 1.x unshrinking method supported)
  16:         USE_DEFLATE64 (PKZIP 4.x Deflate64(tm) supported)
  17:         VMS_TEXT_CONV
  18:         [decryption, version 2.9 of 05 May 2000]
  19:  
  20: UnZip and ZipInfo environment options:
  21:            UNZIP:  [none]
  22:         UNZIPOPT:  [none]
  23:          ZIPINFO:  [none]
  24:       ZIPINFOOPT:  [none]

于是我从http://sourceforge.net/projects/p7zip/files/p7zip/上下载了p7zip_9.20.1_src_all.tar.bz2 安装包文件。

   1: [root@gsp tmp]# tar -xjpf   p7zip_9.20.1_src_all.tar.bz2
   2: [root@gsp tmp]cd p7zip_9.20.1
   3: [root@gsp p7zip_9.20.1]# make && make install
   4: mkdir -p bin
   5: make -C CPP/7zip/Bundles/Alone all
   6: make[1]: Entering directory `/u02/tmp/p7zip_9.20.1/CPP/7zip/Bundles/Alone'
   7: g++ -O -pipe -s -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DNDEBUG -D_REENTRANT -DENV_UNIX -D_7ZIP_LARGE_PAGES -DBREAK_HANDLER -DUNICODE -D_UNICODE -c -I. -I../../../myWindows -I../../../ -I../../../include_windows ../../../myWindows/myGetTickCount.cpp
   8: make[1]: g++: Command not found
   9: make[1]: *** [myGetTickCount.o] Error 127
  10: make[1]: Leaving directory `/u02/tmp/p7zip_9.20.1/CPP/7zip/Bundles/Alone'
  11: make: *** [7za] Error 2
  12:  

结果安装过程中出现上面错误,出现上面错误是因为这台服务器是刚安装的测试服务器,还没有安装gcc和gcc-c++包。

   1: [root@gsp Server]# rpm -q gcc gcc-c++
   2: package gcc is not installed
   3: package gcc-c++ is not installed

于是配置YUM源后,安装gcc 和 gcc-c++

   1: [root@gsp yum.repos.d]# more rhel-debuginfo.repo 
   2: [rhel-debuginfo]
   3:  
   4: name=Red Hat Enterprise Linux LOCAL SOURCE
   5:  
   6: baseurl=file:///mnt/cdrom/Server
   7:  
   8: enabled=1
   9:  
  10: gpgcheck=0
  11:  
  12:  
  13:  
  14: [root@gsp yum.repos.d]# yum install gcc
  15: Loaded plugins: rhnplugin, security
  16: This system is not registered with ULN.
  17: ULN support will be disabled.
  18: Setting up Install Process
  19: Resolving Dependencies
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表