deb安装包制作

deb安装包制作

  1. deb安装包结构
  2. 写文件
  3. 打包
  4. 验证

1.deb安装包结构

随便找一个包openssh-client_1%3a8.2p1-4ubuntu0.1_amd64.deb,随便修改一下

jing@pc01:/var/cache/apt/archives$ sudo dpkg -X openssh-client_1%3a8.2p1-4ubuntu0.1_amd64.deb extract
jing@pc01:/var/cache/apt/archives$ sudo dpkg -e openssh-client_1%3a8.2p1-4ubuntu0.1_amd64.deb extract/DEBIAN
jing@pc01:/var/cache/apt/archives$ tree extract/
extract/
├── DEBIAN
│   ├── conffiles  #主配置文件
│   ├── control  #记录软件包各种信息 
│   ├── md5sums  #下面个文件哈希值
│   ├── postinst  #安装后运行脚本(文件拷贝到系统后运行的脚本)
│   ├── postrm  #卸载包后运行脚本
│   ├── preinst  #安装前运行脚本(拷贝文件到系统前运行的脚本)
│   └── prerm  #卸载前运行的脚本
├── etc   #以下是配置文件
│   └── ssh
│       ├── ssh_config
│       └── ssh_config.d
└── usr
    ├── bin
    │   ├── scp
    │   ├── sftp
    │   ├── slogin -> ssh
    ........

2.control文件编写

Package: $softname
Source: Unknown
Version: $version-kylin
Architecture: $platform
Maintainer: haodong zhang <[email protected]>
Installed-Size: Unknown
Depends: Unknown
Recommends: Unknown
Suggests: Unknown
Conflicts: Unknown
Breaks: Unknown
Replaces: Unknown
Provides: Unknown
Section: Unknown
#Priority: Unknown
#Multi-Arch: Unknown
Homepage: Unknown
Description: This installation package is for internal use only,such as external use will not bear any responsibility. The installation package is mainly used for ha debugging of secret-related machines,and no responsibility is assumed for the use of external machines.

3.打包

新建build目录用于存放制作好的deb包

dpkg -b extract/ build

4.验证

dpkg -c xxx.deb
dpkg -i xxx.deb
dpkg -s xxx.deb  #检查是否安装此包
dpkg -r xxx.deb  #删包
dpkg -P xxx.deb  #删包删文件
dpkg -l xxx.dev  #看包信息

一键制作deb包脚本/PDF下载:https://github.com/zhd-haodong/Ebook

deb博客链接:
https://blog.csdn.net/qq_44839276/article/details/107744043
https://blog.csdn.net/qq_44839276/article/details/107735778

你可能感兴趣的:(Ubuntu)