三三世界-百宝箱

文章 分类 标签
130 9 247

公告

暂无站点公告

CentOS中如何安装7ZIP

三三 2022-05-26 1915 0条评论 Linux使用 Linux7zip安装使用

首页 / 正文

问题背景:
客户上传的文件解压失败,提示错误:

warning [tren2.zip]:  417890055 extra bytes at beginning or within zipfile
  (attempting to process anyway)
error [tren2.zip]:  start of central directory not found;
  zipfile corrupt.
  (please check that you have transferred or created the zipfile in the
  appropriate BINARY mode and that you have compiled UnZip properly)

这个问题有几种可能

1,zip文件不能解压超过4G的文件,
2,可能是文件格式问题,或者压缩有问题,安装了rar不能解压,结果使用7zip解压完成。

7zip是一个比较好的软件,以高压缩率著称,并且是一款免费开源的压缩软件。在常规的Linux发行版中,无法通过简单的yum命令来安装该软件。但是在centos安装有的不知道的,可以参考本教程。

1、yum安装
命令如下:

yum install -y p7zip

使用7zip的命令是7za。比如 :

7za x xxxx.zip

安装完成后的使用方法:

7za {a|d|l|e|u|x} 压缩包文件名 {文件列表或目录,可选},各参数介绍:

a  向压缩包里添加文件或创建压缩包,如向001.7z添加001.jpg,执行:7za a 001.7z 001.jpg;将001目录打包执行:7za a 001.7z 001;
d  从压缩里删除文件,如将001.7z里的001.jpg删除,执行:7za d 001.7z 001.jpg
l  列出压缩包里的文件,如列出001.7z里的文件,执行:7za l 001.7z
e  解压到当前目录,目录结构会被破坏,如001.rar内有如下目录及文件123/456/789.html,
执行:7za e 001.rar,目录123和456及文件789.html都会存放在当前目录下。
x  以完整路径解压。

zip文件解压中文文件乱码问题,由于zip文件中没有声明其编码,所以在Linux上使用unzip解压以默认编码解压,中文文件名会出现乱码。

第2种,源码编译安装

官网下载地址:http://www.7-zip.org/download.html
源文件项目地址:http://sourceforge.net/projects/p7zip/

执行以下命令下载安装:

wget http://nchc.dl.sourceforge.net/project/p7zip/p7zip/9.20.1/p7zip_9.20.1_src_all.tar.bz2
tar -jxvf p7zip_9.20.1_src_all.tar.bz2
cd p7zip_9.20.1
make
make install

最后一步make install后出现以下信息,即为安装完毕。

./install.sh /usr/local/bin /usr/local/lib/p7zip /usr/local/man /usr/local/share/doc/p7zip
- installing /usr/local/bin/7za
- installing /usr/local/man/man1/7z.1
- installing /usr/local/man/man1/7za.1
- installing /usr/local/man/man1/7zr.1
- installing /usr/local/share/doc/p7zip/README
- installing /usr/local/share/doc/p7zip/ChangeLog
- installing HTML help in /usr/local/share/doc/p7zip/DOCS

第3种,rpm安装

下载地址:http://pkgs.repoforge.org/p7zip/,请以最新版为准。

在 CentOS 6.x 32位下安装7ZIP

wget http://pkgs.repoforge.org/p7zip/p7zip-9.20.1-1.el6.rf.i686.rpm
rpm -ivh p7zip-9.20.1-1.el6.rf.i686.rpm

在 CentOS 6.x 64位下安装7ZIP

wget http://pkgs.repoforge.org/p7zip/p7zip-9.20.1-1.el6.rf.x86_64.rpm
rpm -ivh p7zip-9.20.1-1.el6.rf.x86_64.rpm

安装后使用方法同上。

评论(0)

当前没有评论,还不快来留下第一个脚印吧


Copyright 2021 三三世界-百宝箱. All Rights Reserved.

最新评论

  • 三三

    @Doug Shume it's ok for me , you can post here.

  • refugiaguenther

    Saved as a favorite, I like your website!

  • josefa

    If some one wishes to be updated with hottest technologies after that he must be visit this site and be up to date daily.

  • Penzu

    Heello would you mind sharing which blog platform you're using? I'm planning to start my own blog in the near future but I'm having a tough time making a decision between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your layout seems different then moost blogs and I'm looking for something completely unique. P.S Apologies forr being off-topic butt I had to ask!

  • Yupoo Fendi

    Thanks to my father who shared with me regarding this webpage, this website is genuinely amazing.

  • Doug Shume

    Hi, I have an overflow of customers that I'd like to send to you but I want to make sure you can handle more leads, let me know if you'd like me to send you more info.

  • SuperWind

    zh.us.to 有效
    kms.03k.org 有效
    kms.chinancce.com
    kms.shuax.com 有效
    kms.dwhd.org 有效
    kms.luody.info 有效
    kms.digiboy.ir 有效
    kms.lotro.cc 有效
    www.zgbs.cc 有效
    cy2617.jios.org 有效

  • 三三

    @         权限问题,试试sudo 再加命令。

  •         

    你好提示Permission denied 怎么办啊

日历

2024年05月

   1234
567891011
12131415161718
19202122232425
262728293031 

文章目录

上一张 下一张