Mirror site is read only www.netnr.com
netnr/ dpkg.sh 2023-09-05 11:23
打包 deb
# 结构
pack_deb
- DEBIAN # 打包配置文件夹
    - control # 必需,软件包的元数据信息,如名称、版本、作者、依赖关系等。
    - postinst # 安装后执行
    - postrm # 卸载后执行
- opt/xops_server # 待打包软件目录,安装路径为 /opt/xops_server


# 打包
chmod -R 0775 pack_deb/DEBIAN
dpkg -b pack_deb xops_server-arm64-1.710.0.deb


# DEBIAN/control 注意,包名限英文和+-字符
Package:xops-server
Version:1.710.0
Section:net
Priority:optional
Depends:
Architecture:arm64
description:XOps Server
maintainer:netnr


# DEBIAN/postinst
#!/bin/bash

chown root:root /opt/xops_server/xops_server
chmod 0775 /opt/xops_server/xops_server


# DEBIAN/postrm
#!/bin/bash

echo "remove /opt/xops_server"
rm -rf /opt/xops_server


# 更多
dpkg -l # 列出已安装
dpkg -l | grep keyword # 搜索
dpkg -s package_name # 搜索

dpkg -I package.deb # 查看包信息