zoukankan      html  css  js  c++  java
  • checkinstall制作linux安装包

    转自:http://qubaoquan.blog.51cto.com/1246748/304958

    checkinstall ,是一个能从 tar.gz 类的源代码自动生成 RPM /Debian 或Slackware 安装包的程序。

    本文环境介绍:本文的示例程序时nagios的插件,目的是把nagios的插件编译安装好后压成一个rpm包,便于安装和卸载

    1. 首先安装checkinstall程序

    [root@localhost ~]# tar zvxf checkinstall-1.6.2.tar.gz

    [root@localhost ~]# cd checkinstall-1.6.2

    [root@localhost checkinstall-1.6.2]# make

    [root@localhost checkinstall-1.6.2]# make install

    2.编译安装nagios的插件

    [root@localhost checkinstall-1.6.2]# cd /srv/

    [root@localhost srv]# tar zvxf nagios-plugins-1.4.14.tar.gz

    [root@localhost srv]# cd nagios-plugins-1.4.14

    [root@localhost nagios-plugins-1.4.14]# ./configure --prefix=/usr/local/nagios

    [root@localhost nagios-plugins-1.4.14]# make

    3.到此呢,一般编译安装源码包的时候下一就是make install了,此处不用,下一步是运行checkinstall,它会完成make install,同时呢,会有一些交互信息,主要的就是叫你选择压制包的格式,有RPM /Debian 或Slackware,记住一定要用sudo即使你是root用户

    [root@localhost nagios-plugins-1.4.14]# sudo checkinstall

    此处选择是---y创建默认的软件包描述文件

    此处选择R也就是压制成rpm格式的安装包

    此处叫你输入一个描述,可以直接回车下一步

    此处叫你选择要更改的一些软件包的描述信息,按标号修改响应的设置,如果没有修改直接回车下一步,接下来就是开始make install的过程同时压制rpm包(略)

    此处打印出安装的结果,即RPM包的路径和安装方式

    4. 进入RPM包的路径看是否打包完成

    [root@localhost nagios-plugins-1.4.14]# cd /usr/src/redhat/RPMS/i386/

    [root@localhost i386]# ls

    5.安装rpm包

    [root@localhost i386]# rpm -ivh nagios-plugins-1.4.14-1.i386.rpm

    6. 查看安装是否完整,打印文件列表

    [root@localhost i386]# rpm -ql nagios-plugins

    7. 卸载掉安装的rpm包

    [root@localhost ~]# rpm -qa |grep nagios

    nagios-plugins-1.4.14-1

    [root@localhost ~]# rpm -e nagios-plugins

    [root@localhost ~]# ll /usr/local/nagios/libexec

    total 0

    完!

  • 相关阅读:
    如何判断第一个节区头的RVA
    从可执行文件中删除.reloc节区
    动态规划(dynamic programming)
    Ubuntu18安装SQL server
    Ubuntu16.04突然断网
    [Toddler's Bottle]做题记录
    BUU | pwnable_orw
    BUU| 基础破解
    web.xml
    PKIX
  • 原文地址:https://www.cnblogs.com/itech/p/1952908.html
Copyright © 2011-2022 走看看