Deb packaging process steps

1. Preliminary preparation

  • An executable program, the Java program (xxx.jar) is introduced here, and lzj.jar is used below to illustrate

2. File structure

  • Simulate a Linux file structure in any directory , here select /home/LZJ/file
  • The outer large files are named freely. Take project as an example, mkdir /home/LZJ/file/project, after cd project, create a three-level directory, mkdir DEBIAN, mkdir usr, mkdir opt
  • Create control, copyright, postinst and other files under DEBIAN
  • Create a share directory under the usr directory, and create applications and icons under the share directory
  • Put the executable program lzj.jar in the opt directory (xxx.desktop file configures the Exec execution command)
├── project
│   ├── DEBIAN
│       └── control
│       └── copyright
│       └── ......
│   └── usr
│       └── share
│           ├── applications(在这里添加xxx.desktop,使应用中能够加载出你的应用)
│           	└── xxx.desktop
│           └── icons(图标)
│           	└── xxx.png
│	  ├── opt
│       └── lzj.jar

Three, create a control file

vim control
  • Enter the following
Package: 自定义
Replaces: 自定义
Version: 1.0.0
Section: readerTest
Priority: optional
Architecture: 自定义
Maintainer: 自定义
Installed-Size: 1024
Recommends:
Homepage: 自定义
Depends:
Description: 自定义

Fourth, create a copyright file

vim copyright
  • Enter the following
Format: http://dep.debian.net/deps/dep5/
Upstream-Name: 自定义
Upstream-Contact: 自定义
Source: 自定义

Files: *
Copyright: Copyright xxxx.

Five, create xxx.desktop file

cd /usr/applications
vim xxx.desktop
  • Enter the following
[Desktop Entry]
Encoding=UTF-8
Name=自定义
Comment=自定义
Exec=java -jar /opt/lzj.jar(编写jar文件执行命令)
Icon=/usr/share/icons/xxx.png
Terminal=false
StartupNotify=true
Type=Application
Categories=Application

Six, make deb file

  • Bale
sudo dpkg -b project project_v1.0.0_amd64.deb
  • installation
sudo dpkg -i project_v1.0.0_amd64.deb
  • Uninstall
sudo dpkg -r project

Guess you like

Origin blog.csdn.net/LvJzzZ/article/details/109452895
Recommended