分享

linux 源码安装 zip/unzip

 XeonGate 2021-06-23

场景说明

  1. Linux服务器,没有root权限

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

  3. https://blog.csdn.net/github_28260175/article/details/99420182

解决办法

自己用源码编译

步骤

  1. 下载zip/unzip的源码包 -> 工具主页 Info-ZIP
    实际上主页的下载地址过期了 -> 真下载主页 sourceforge

  2. tar解压

  3. 到解压好的文件夹里,把./unix/Makefile拷到根目录.下,用make generic安装即可。

过程

  1. 下载unzip60.tar.gz

wget http://downloads./infozip/unzip60.tar.gz

或者

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

tar xzvf unzip60.tar.gz
  1. 安装

cp ./unix/Makefile .
make clean
make generic
下载文件后解压可得到 unzip60.tar.gz 和 zip30.tar.gz 两个文件。
编译zip30.tar.gz:
tar -zxvf zip30.tar.gz
cd zip30
make -f unix/Makefile generic
编译完成后当前目录存在zip可运行文件,

若要自定义交叉编译工具,比如在嵌入式系统运行,则只要修改
unix\Makefile文件下的:
#CC = cc 这句屏蔽 并修改对应的路径
CC = /home/mipsel-unknown-linux-gnu/bin/mipsel-unknown-linux-gnu-gcc
然后重新clean 后再编译即可:
make -f unix/Makefile clean
make -f unix/Makefile generic

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多