Home page Blog page

2019/08/13

linux 源码安装 zip/unzip

场景说明

  1. Linux服务器,没有root权限
  2. 需要使用zip/unzip,但遗憾的是服务器没有安装

解决办法

自己用源码编译

步骤

  1. 下载zip/unzip的源码包 -> 工具主页 Info-ZIP
    实际上主页的下载地址过期了 -> 真下载主页 sourceforge
  2. tar解压
  3. 到解压好的文件夹里,把./unix/Makefile拷到根目录.下,用make generic安装即可。

过程

  1. 下载unzip60.tar.gz

    1
    wget http://downloads.sourceforge.net/infozip/unzip60.tar.gz

    或者

    1
    wget https://nchc.dl.sourceforge.net/project/infozip/UnZip 6.x %28latest%29/UnZip 6.0/unzip60.tar.gz
  2. 解压

    1
    tar xzvf unzip60.tar.gz
  3. 安装

    1
    2
    3
    cp ./unix/Makefile .
    make clean
    make generic
  4. 验证是否安装成功

    1
    2
    zip
    unzip